8000 gh-117431: Improve performance of startswith and endswith by eendebakpt · Pull Request #117782 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content
10000

gh-117431: Improve performance of startswith and endswith #117782

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

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update comment
  • Loading branch information
eendebakpt committed May 20, 2024
commit 9f8e4b880c9c8d08f4a4f5973e1b64db846ab0c7
6 changes: 3 additions & 3 deletions Objects/unicodeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -9286,9 +9286,9 @@ tailmatch(PyObject *self,
}
/* otherwise we have to compare each character by first accessing it */
else {
/* We do not need to compare 0 and len(substring)-1 because
the if statement above ensured already that they are equal
when we end up here. */
/* We do not need to compare len(substring)-1 because the if
statement above ensured already that they are equal when we
end up here. */
for (i = 0; i < end_sub; ++i) {
if (PyUnicode_READ(kind_self, data_self, offset + i) !=
PyUnicode_READ(kind_sub, data_sub, i))
Expand Down
0