Skip to content

Commit

Permalink
Use Math.abs in Sonic.java
Browse files Browse the repository at this point in the history
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166820970
  • Loading branch information
andrewlewis authored and ojw28 committed Sep 6, 2017
1 parent 5b9f4d9 commit 53343c3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ private int findPitchPeriodInRange(short[] samples, int position, int minPeriod,
for (int i = 0; i < period; i++) {
short sVal = samples[position + i];
short pVal = samples[position + period + i];
diff += sVal >= pVal ? sVal - pVal : pVal - sVal;
diff += Math.abs(sVal - pVal);
}
// Note that the highest number of samples we add into diff will be less than 256, since we
// skip samples. Thus, diff is a 24 bit number, and we can safely multiply by numSamples
Expand Down

0 comments on commit 53343c3

Please sign in to comment.