Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bytes] fix bytesFindIndex and bytesFindLastIndex #381

Merged
merged 5 commits into from May 7, 2019

Conversation

4 participants
@arcatdmz
Copy link
Contributor

commented May 5, 2019

Bug

bytesFindIndex and bytesFindLastIndex in deno_std/bytes cannot find the binary pattern when its occurrence has an overlap with a partly (but not completely) matching sequence.

  • target: 001
  • pattern: 01
  • expected bytesFindIndex result: 1
  • current bytesFindIndex result: -1

Reproduction

Existing test cases are edited to reproduce the bug: arcatdmz@fe9d5b4

Two corresponding tests fail accordingly: https://gist.github.com/arcatdmz/08ae107dd5e29e2aaebf18e1d8b76d43

Fix

This pull request contains a commit that fixes the bug: arcatdmz@1251423

Context

@CLAassistant

This comment has been minimized.

Copy link

commented May 5, 2019

CLA assistant check
All committers have signed the CLA.

[bytes] apply prettier
deno --allow-read --allow-write prettier/main.ts --ignore node_modules --ignore testdata --ignore vendor
@ry
Copy link
Contributor

left a comment

Thanks for the fix @arcatdmz ! I just one comment...

@keroxp please review if you have time.

Show resolved Hide resolved bytes/bytes_test.ts Outdated

arcatdmz added some commits May 6, 2019

@keroxp

keroxp approved these changes May 7, 2019

Copy link
Contributor

left a comment

Nice work. LGTM

@ry

ry approved these changes May 7, 2019

Copy link
Contributor

left a comment

Thanks!

@ry ry merged commit 8714252 into denoland:master May 7, 2019

5 checks passed

denoland.deno_std Build #20190506.1 succeeded
Details
denoland.deno_std (Linux) Linux succeeded
Details
denoland.deno_std (Mac) Mac succeeded
Details
denoland.deno_std (Windows) Windows succeeded
Details
license/cla Contributor License Agreement is signed.
Details

arcatdmz added a commit to arcatdmz/danoweb that referenced this pull request May 7, 2019

@arcatdmz arcatdmz deleted the arcatdmz:fix-bytes-bytesFindIndex branch May 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.