Skip to content

Commit 6b3cf03

Browse files
committed
resolve feedback
1 parent c705a5d commit 6b3cf03

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/buffer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ const encodingOps = {
714714
write: asciiWrite,
715715
slice: asciiSlice,
716716
indexOf: (buf, val, byteOffset, dir) =>
717-
indexOfString(buf, val, byteOffset, encodingsMap.latin1, dir),
717+
indexOfString(buf, val, byteOffset, encodingsMap.ascii, dir),
718718
},
719719
base64: {
720720
encoding: 'base64',

src/node_buffer.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,7 @@ void IndexOfString(const FunctionCallbackInfo<Value>& args) {
10501050
needle_length,
10511051
offset,
10521052
is_forward);
1053-
} else if (enc == LATIN1) {
1053+
} else if (enc == ASCII || enc == LATIN1) {
10541054
uint8_t* needle_data = node::UncheckedMalloc<uint8_t>(needle_length);
10551055
if (needle_data == nullptr) {
10561056
return args.GetReturnValue().Set(-1);

0 commit comments

Comments
 (0)