File tree Expand file tree Collapse file tree 1 file changed +1
-4
lines changed Expand file tree Collapse file tree 1 file changed +1
-4
lines changed Original file line number Diff line number Diff line change 1
1
package json .ext ;
2
2
3
3
import java .io .IOException ;
4
- import javax .naming .directory .NoSuchAttributeException ;
5
4
6
5
import jdk .incubator .vector .ByteVector ;
7
6
import jdk .incubator .vector .VectorMask ;
8
7
import jdk .incubator .vector .VectorOperators ;
9
8
import jdk .incubator .vector .VectorSpecies ;
10
- import jdk .jfr .RecordingState ;
11
9
12
10
public class VectorizedEscapeScanner implements EscapeScanner {
13
11
public static EscapeScanner .ScalarEscapeScanner FALLBACK = new EscapeScanner .ScalarEscapeScanner (StringEncoder .ESCAPE_TABLE );
@@ -29,11 +27,10 @@ public boolean scan(State _state) throws IOException {
29
27
30
28
while ((state .ptr + state .pos ) + species .length () < state .len ) {
31
29
ByteVector chunk = ByteVector .fromArray (species , state .ptrBytes , state .ptr + state .pos );
32
- ByteVector zero = ByteVector .broadcast (species , 0 );
33
30
34
31
// bytes are unsigned in java, so we need to check for negative values
35
32
// 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 );
37
34
38
35
VectorMask <Byte > tooLowOrDblQuote = chunk .lanewise (VectorOperators .XOR , ByteVector .broadcast (species , 2 ))
39
36
.lt (ByteVector .broadcast (species , 33 ));
You can’t perform that action at this time.
0 commit comments