Minor Improvements (#701)

* Minor Improvement:

* Add final variable.try to make the code read-only
* inline Variable. Simplify code

* Update UnicodeUnpairedSurrogateRemover.java

Better comment.

Co-authored-by: Gary Gregory <garydgregory@users.noreply.github.com>
This commit is contained in:
Arturo Bernal 2021-02-10 23:16:02 +01:00 committed by GitHub
parent 556b744c27
commit 02ff51e504
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 7 deletions

View File

@ -34,12 +34,9 @@ public class UnicodeUnpairedSurrogateRemover extends CodePointTranslator {
*/
@Override
public boolean translate(final int codepoint, final Writer out) throws IOException {
if (codepoint >= Character.MIN_SURROGATE && codepoint <= Character.MAX_SURROGATE) {
// It's a surrogate. Write nothing and say we've translated.
return true;
}
// true: It's a surrogate. Write nothing and say we've translated.
return codepoint >= Character.MIN_SURROGATE && codepoint <= Character.MAX_SURROGATE;
// It's not a surrogate. Don't translate it.
return false;
}
}

View File

@ -820,8 +820,8 @@ static class TimeZoneStrategy extends PatternStrategy {
private final Map<String, TzInfo> tzNames= new HashMap<>();
private static class TzInfo {
TimeZone zone;
int dstOffset;
final TimeZone zone;
final int dstOffset;
TzInfo(final TimeZone tz, final boolean useDst) {
zone = tz;