Skip to content

Commit 5de293a

Browse files
committed
Removed unnecessary code and fixed a comment.
1 parent c999baf commit 5de293a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

ext/json/ext/generator/generator.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,6 @@ static inline FORCE_INLINE uint8x16_t neon_rules_update(const char *ptr)
331331
uint8x16_t has_dblquote = vceqq_u8(chunk, dblquote);
332332
uint8x16_t needs_escape = vorrq_u8(too_low, vorrq_u8(has_backslash, has_dblquote));
333333

334-
vandq_u8(needs_escape, vdupq_n_u8(0x1));
335-
336334
return needs_escape;
337335
}
338336

@@ -390,9 +388,9 @@ static inline unsigned char search_escape_basic_neon(search_state *search)
390388
* Next we compute the bitwise AND between each byte and 0x1 and compute the horizontal sum of
391389
* the values in the vector. This computes how many bytes need to be escaped within this chunk.
392390
*
393-
* If the sum is zero, no bytes need to be escaped and we can skip 16 bytes.
394-
*
395-
* If the sum is greater than or equal to 8, then we can assume that at least half of the bytes in chunk.
391+
* Finally we compute a mask that indicates which bytes need to be escaped. If the mask is 0 then,
392+
* no bytes need to be escaped and we can continue to the next chunk. If the mask is not 0 then we
393+
* have at least one byte that needs to be escaped.
396394
*/
397395
while (search->ptr + sizeof(uint8x16_t) <= search->end) {
398396
uint8x16_t needs_escape = neon_rules_update(search->ptr);

0 commit comments

Comments
 (0)