Re: [2/4] ant git commit: Remove extraneous casts and (un)boxing, tersify logic

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [2/4] ant git commit: Remove extraneous casts and (un)boxing, tersify logic

Stefan Bodewig
On 2018-04-01, <[hidden email]> wrote:

> http://git-wip-us.apache.org/repos/asf/ant/blob/95495d57/src/main/org/apache/tools/bzip2/BlockSort.java
> ----------------------------------------------------------------------
> diff --git a/src/main/org/apache/tools/bzip2/BlockSort.java b/src/main/org/apache/tools/bzip2/BlockSort.java

> @@ -651,7 +648,7 @@ class BlockSort {
>                          if (onceRun) {
>                              fmap[j] = a;
>                              if ((j -= h) <= mj) { //NOSONAR
> -                                break HAMMER;
> +                                break;
>                              }

Whoa. You are touching the scariest code inside of Ant :-)

Reviewing the break and continue changes will take some time.

Have you performed the changes with the help of some tools? Those loops
have been hand-optimized (by somebody who I hope understood the code
better than me) and I'm extremely reluctant to touching it at all.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [2/4] ant git commit: Remove extraneous casts and (un)boxing, tersify logic

Gintautas Grigelionis
2018-04-06 16:09 GMT+00:00 Stefan Bodewig <[hidden email]>:

> On 2018-04-01, <[hidden email]> wrote:
>
> > http://git-wip-us.apache.org/repos/asf/ant/blob/95495d57/src
> /main/org/apache/tools/bzip2/BlockSort.java
> > ----------------------------------------------------------------------
> > diff --git a/src/main/org/apache/tools/bzip2/BlockSort.java
> b/src/main/org/apache/tools/bzip2/BlockSort.java
>
> > @@ -651,7 +648,7 @@ class BlockSort {
> >                          if (onceRun) {
> >                              fmap[j] = a;
> >                              if ((j -= h) <= mj) { //NOSONAR
> > -                                break HAMMER;
> > +                                break;
> >                              }
>
> Whoa. You are touching the scariest code inside of Ant :-)
>
> Reviewing the break and continue changes will take some time.
>
> Have you performed the changes with the help of some tools? Those loops
> have been hand-optimized (by somebody who I hope understood the code
> better than me) and I'm extremely reluctant to touching it at all.
>
> Stefan
>

The code sure looks scary, but the change really simple: remove extraneous
labels on break/continue.
I will double-check whether the labels still provide some useful hints to
Java compiler.

Gintas
Reply | Threaded
Open this post in threaded view
|

Re: [2/4] ant git commit: Remove extraneous casts and (un)boxing, tersify logic

Stefan Bodewig
On 2018-04-06, Gintautas Grigelionis wrote:

> The code sure looks scary, but the change really simple: remove
> extraneous labels on break/continue.  I will double-check whether the
> labels still provide some useful hints to Java compiler.

Finally did so as well by now. Looks good, thanks.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]