@@ -73,32 +73,25 @@ public static String escape(final String ident) {
7373 // If the character is in the range [\1-\1f] (U+0001 to U+001F) or is U+007F,
7474 // then the character escaped as code point.
7575 else if (('\u0001' <= c && c <= '\u001f' ) || c == '\u007f' ) {
76- escaped .append ('\\' );
77- escaped .append (Integer .toHexString (c ));
78- escaped .append (' ' );
76+ escaped .append ('\\' ).append (Integer .toHexString (c )).append (' ' );
7977 }
8078
8179 // If the character is the first character and is in the range [0-9] (U+0030 to U+0039),
8280 // then the character escaped as code point.
8381 else if (i == 0 && ('\u0030' <= c && c <= '\u0039' )) {
84- escaped .append ('\\' );
85- escaped .append (Integer .toHexString (c ));
86- escaped .append (' ' );
82+ escaped .append ('\\' ).append (Integer .toHexString (c )).append (' ' );
8783 }
8884
8985 // If the character is the second character and is in the range [0-9] (U+0030 to U+0039)
9086 // and the first character is a "-" (U+002D), then the character escaped as code point.
9187 else if (i == 1 && ('\u0030' <= c && c <= '\u0039' ) && ident .charAt (0 ) == '-' ) {
92- escaped .append ('\\' );
93- escaped .append (Integer .toHexString (c ));
94- escaped .append (' ' );
88+ escaped .append ('\\' ).append (Integer .toHexString (c )).append (' ' );
9589 }
9690
9791 // If the character is the first character and is a "-" (U+002D),
9892 // and there is no second character, then the escaped character.
9993 else if (i == 0 && c == '-' && length == 1 ) {
100- escaped .append ('\\' );
101- escaped .append (c );
94+ escaped .append ('\\' ).append (c );
10295 }
10396
10497 // If the character is not handled by one of the above rules
@@ -117,8 +110,7 @@ else if (c >= '\u0080'
117110
118111 // Otherwise, the escaped character
119112 else {
120- escaped .append ('\\' );
121- escaped .append (c );
113+ escaped .append ('\\' ).append (c );
122114 }
123115 }
124116
0 commit comments