Skip to content

Commit 8e42c0f

Browse files
committed
Cleanups.
1 parent 55aee21 commit 8e42c0f

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

java/src/json/ext/VectorizedEscapeScanner.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
package json.ext;
22

33
import java.io.IOException;
4-
import javax.naming.directory.NoSuchAttributeException;
54

65
import jdk.incubator.vector.ByteVector;
76
import jdk.incubator.vector.VectorMask;
87
import jdk.incubator.vector.VectorOperators;
98
import jdk.incubator.vector.VectorSpecies;
10-
import jdk.jfr.RecordingState;
119

1210
public class VectorizedEscapeScanner implements EscapeScanner {
1311
public static EscapeScanner.ScalarEscapeScanner FALLBACK = new EscapeScanner.ScalarEscapeScanner(StringEncoder.ESCAPE_TABLE);
@@ -29,11 +27,10 @@ public boolean scan(State _state) throws IOException {
2927

3028
while ((state.ptr + state.pos) + species.length() < state.len) {
3129
ByteVector chunk = ByteVector.fromArray(species, state.ptrBytes, state.ptr + state.pos);
32-
ByteVector zero = ByteVector.broadcast(species, 0);
3330

3431
// bytes are unsigned in java, so we need to check for negative values
3532
// to determine if we have a byte that is less than 0 (>= 128).
36-
VectorMask<Byte> negative = zero.lt(chunk);
33+
VectorMask<Byte> negative = ByteVector.zero(species).lt(chunk);
3734

3835
VectorMask<Byte> tooLowOrDblQuote = chunk.lanewise(VectorOperators.XOR, ByteVector.broadcast(species, 2))
3936
.lt(ByteVector.broadcast(species, 33));

0 commit comments

Comments
 (0)