Skip to content

Commit

Permalink
Fix off-by-one error in AsciiDigits.asciiDigits initialization.
Browse files Browse the repository at this point in the history
Fixes #3761.

RELNOTES=n/a

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=288531873
  • Loading branch information
perceptron8 authored and netdpb committed Jan 9, 2020
1 parent e8e8ba8 commit 682a25f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions android/guava/src/com/google/common/primitives/Longs.java
Expand Up @@ -328,10 +328,10 @@ private AsciiDigits() {}
static {
byte[] result = new byte[128];
Arrays.fill(result, (byte) -1);
for (int i = 0; i <= 9; i++) {
for (int i = 0; i < 10; i++) {
result['0' + i] = (byte) i;
}
for (int i = 0; i <= 26; i++) {
for (int i = 0; i < 26; i++) {
result['A' + i] = (byte) (10 + i);
result['a' + i] = (byte) (10 + i);
}
Expand Down
4 changes: 2 additions & 2 deletions guava/src/com/google/common/primitives/Longs.java
Expand Up @@ -330,10 +330,10 @@ private AsciiDigits() {}
static {
byte[] result = new byte[128];
Arrays.fill(result, (byte) -1);
for (int i = 0; i <= 9; i++) {
for (int i = 0; i < 10; i++) {
result['0' + i] = (byte) i;
}
for (int i = 0; i <= 26; i++) {
for (int i = 0; i < 26; i++) {
result['A' + i] = (byte) (10 + i);
result['a' + i] = (byte) (10 + i);
}
Expand Down

0 comments on commit 682a25f

Please sign in to comment.