mirror of
https://github.com/denoland/deno.git
synced 2025-10-02 23:24:37 +00:00
parent
9f33cd2896
commit
17663c1232
41 changed files with 734 additions and 649 deletions
|
@ -22,7 +22,7 @@ export function bytesFindIndex(a: Uint8Array, pat: Uint8Array): number {
|
|||
}
|
||||
|
||||
/** Find last index of binary pattern from a. If not found, then return -1 **/
|
||||
export function bytesFindLastIndex(a: Uint8Array, pat: Uint8Array) {
|
||||
export function bytesFindLastIndex(a: Uint8Array, pat: Uint8Array): number {
|
||||
const e = pat[pat.length - 1];
|
||||
for (let i = a.length - 1; i >= 0; i--) {
|
||||
if (a[i] !== e) continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue