buffer: improve performance of buffer indexof method
Inspired by #12361, making buffer indexof
method be consistent with byteLength
, stringSlice
, Buffer.prototype.write
, and IIUC this should have some performance improvement.
(I've run the buffer benchmark and seems a bit of improvement, but it took too long and my laptop has no power, so I canceled -:(
/cc @mscdex
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines