[
https://issues.apache.org/jira/browse/MATH-1054?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13812157#comment-13812157
]
Gilles commented on MATH-1054:
------------------------------
Thanks for the work. Unfortunately, the better code now triggers several
"errors" in the CheckStyle report:
{noformat}
Unnecessary parentheses around assignment right-hand side.
{noformat}
An example is:
{code}
bits |= (((long) next(32)) & 0xffffffffL);
{code}
Would you care to silence CheckStyle by removing the superfluous pair of
parentheses?
> Standardize "x = x op y" to "x op= y"
> -------------------------------------
>
> Key: MATH-1054
> URL: https://issues.apache.org/jira/browse/MATH-1054
> Project: Commons Math
> Issue Type: Improvement
> Affects Versions: 3.2
> Reporter: Sean Owen
> Priority: Minor
> Attachments: MATH-1054.patch
>
>
> Here's one of a series of proposed small simplification/optimizations across
> the code base. This can be rejected.
> The change is to standardize expressions like:
> x[i] = x[i] + b;
> to:
> x[i] += b;
> ... for any operation that has an 'op=' version. The resulting byte code is
> very marginally faster since the target is evaluated once; this might matter
> in a tight loop manipulating a 2D array cell.
> There's a minor argument that it is simpler code. Since both styles appear in
> the code now, this would also represent a tiny standardization.
> The counter-argument is that "x += foo" might risk being misread more readily
> as "x = foo"
--
This message was sent by Atlassian JIRA
(v6.1#6144)