{{ message }}
Add bitap_string_match algo - #11060
Merged
Merged
Conversation
cclauss
reviewed
Oct 28, 2023
cclauss
reviewed
Oct 28, 2023
cclauss
reviewed
Oct 28, 2023
cclauss
reviewed
Oct 28, 2023
Member
There was a problem hiding this comment.
This list is in alphabetical order to make it easy to spot missing values and almost impossible to add duplicates.
cclauss
reviewed
Oct 28, 2023
Comment on lines
+43
to
+45
| m: int = len(pattern) | ||
| if m == 0: | ||
| return 0 |
Member
There was a problem hiding this comment.
All falsey values for pattern are equally dangerous as "".
Python and mypy are both smart enough to figure out without the type hint that if len(pattern) is assigned to m then m is an int.
Suggested change
| m: int = len(pattern) | |
| if m == 0: | |
| return 0 | |
| if not pattern: | |
| return 0 | |
| m = len(pattern) |
| return -1 | ||
|
|
||
| # Initial state of bit string 1110 | ||
| state: int = ~1 |
Member
There was a problem hiding this comment.
Suggested change
| state: int = ~1 | |
| state = ~1 |
cclauss
enabled auto-merge (squash)
October 28, 2023 22:48
cclauss
approved these changes
Oct 28, 2023
Contributor
Author
|
Thank you this review! |
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Describe your change:
Checklist: