feature: Buffer.lastIndexOf
Fixes #4604 (closed)
work done
- Added support for
Buffer.lastIndexOf
to matchBuffer.indexOf
- Can search for a string, another Buffer, or a specific byte value, consistent with
Buffer.indexOf
- For specific byte values, behavior is consistent with
Uint8Array.lastIndexOf
, which is now shadowed byBuffer.lastIndexOf
, so existing code should continue to work - Added test cases
work left to do
- Optimization. The implementation of reverse search in
string_search.cc
is naive and just uses a double for loop. Ideally we'd adaptBoyerMooreSearch
to support reverse search, so thatlastIndexOf
will be equally fast asindexOf