Skip to content

[Minor] Exchange "0 += 1" for "0 = 1" in UnifiedDiffUtils#29

Merged
wumpz merged 1 commit intojava-diff-utils:masterfrom
heisluft:master
Dec 8, 2018
Merged

[Minor] Exchange "0 += 1" for "0 = 1" in UnifiedDiffUtils#29
wumpz merged 1 commit intojava-diff-utils:masterfrom
heisluft:master

Conversation

@heisluft
Copy link
Copy Markdown
Contributor

@heisluft heisluft commented Dec 8, 2018

the line

if(new_ln == 0) {
    new_ln += 1;
}

is equivalent in its result to

if(new_ln == 0) {
    new_ln = 1;
}

, but is converted to more instructions within the JVM than just assigning a new value. This should only gain very littly performance, but is more reasonable to do.

@wumpz wumpz merged commit 5dd05c4 into java-diff-utils:master Dec 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants