File tree Expand file tree Collapse file tree 3 files changed +11
-10
lines changed
js/src/main/scala/com/github/plokhotnyuk/jsoniter_scala/core
jvm/src/main/scala/com/github/plokhotnyuk/jsoniter_scala/core
native/src/main/scala/com/github/plokhotnyuk/jsoniter_scala/core Expand file tree Collapse file tree 3 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -1253,15 +1253,14 @@ final class JsonReader private[jsoniter_scala](
1253
1253
*/
1254
1254
def isCharBufEqualsTo (len : Int , s : String ): Boolean = {
1255
1255
if (s eq null ) throw new NullPointerException
1256
- s.length == len && {
1257
- val charBuf = this .charBuf
1258
- var i = 0
1259
- while (i < len) {
1260
- if (s.charAt(i) != charBuf(i)) return false
1261
- i += 1
1262
- }
1263
- true
1256
+ if (s.length != len) return false
1257
+ val charBuf = this .charBuf
1258
+ var i = 0
1259
+ while (i < len) {
1260
+ if (s.charAt(i) != charBuf(i)) return false
1261
+ i += 1
1264
1262
}
1263
+ true
1265
1264
}
1266
1265
1267
1266
/**
Original file line number Diff line number Diff line change @@ -1276,7 +1276,8 @@ final class JsonReader private[jsoniter_scala](
1276
1276
* @param s the string to match
1277
1277
* @return `true` if the char buffer contains `s`, `false` otherwise
1278
1278
*/
1279
- def isCharBufEqualsTo (len : Int , s : String ): Boolean = s.length == len && {
1279
+ def isCharBufEqualsTo (len : Int , s : String ): Boolean = {
1280
+ if (s.length != len) return false
1280
1281
val charBuf = this .charBuf
1281
1282
var i = 0
1282
1283
while (i < len) {
Original file line number Diff line number Diff line change @@ -1276,7 +1276,8 @@ final class JsonReader private[jsoniter_scala](
1276
1276
* @param s the string to match
1277
1277
* @return `true` if the char buffer contains `s`, `false` otherwise
1278
1278
*/
1279
- def isCharBufEqualsTo (len : Int , s : String ): Boolean = s.length == len && {
1279
+ def isCharBufEqualsTo (len : Int , s : String ): Boolean = {
1280
+ if (s.length != len) return false
1280
1281
val charBuf = this .charBuf
1281
1282
var i = 0
1282
1283
while (i < len) {
You can’t perform that action at this time.
0 commit comments