Skip to content

Commit

Permalink
Automatic code cleanup.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 422297700
  • Loading branch information
Googler authored and copybara-github committed Jan 17, 2022
1 parent 20d8807 commit 07812ff
Showing 1 changed file with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,19 @@ public final String escape(String s) {
return s;
}

final char[] escape(char c) {
if (c < replacementsLength) {
char[] chars = replacements[c];
if (chars != null) {
return chars;
}
}
if (c >= safeMin && c <= safeMax) {
return null;
}
return escapeUnsafe(c);
}

/**
* A thread-local destination buffer to keep us from creating new buffers. The starting size is
* 1024 characters.
Expand Down Expand Up @@ -139,19 +152,6 @@ final String escapeSlow(String s, int index) {
return new String(dest, 0, destIndex);
}

final char[] escape(char c) {
if (c < replacementsLength) {
char[] chars = replacements[c];
if (chars != null) {
return chars;
}
}
if (c >= safeMin && c <= safeMax) {
return null;
}
return escapeUnsafe(c);
}

abstract char[] escapeUnsafe(char c);

/**
Expand Down

0 comments on commit 07812ff

Please sign in to comment.