bpo-24821: Fixed the slowing down to 25 times in the searching of some#505
Merged
serhiy-storchaka merged 6 commits intopython:masterfrom Mar 30, 2017
Conversation
unlucky Unicode characters.
|
@serhiy-storchaka, thanks for your PR! By analyzing the history of the files in this pull request, we identified @Haypo, @Yhg1s, @ned-deily, @florentx and @Carreau to be potential reviewers. |
zhangyangyu
reviewed
Mar 29, 2017
Objects/stringlib/fastsearch.h
Outdated
| if (needle != 0) { | ||
| while (p < e) { | ||
| if (needle != 0) | ||
| while (e - p > MEMCHR_CUT_OFF) { |
Member
There was a problem hiding this comment.
Maybe do ... while ... is better here? The first time e - p > MEMCHR_CUT_OFF is always true.
zhangyangyu
reviewed
Mar 29, 2017
Objects/stringlib/fastsearch.h
Outdated
| if (n > MEMCHR_CUT_OFF) { | ||
| #if STRINGLIB_SIZEOF_CHAR == 1 | ||
| p = memrchr(s, ch, n); | ||
| p = memrchr(s, ch, n * sizeof(STRINGLIB_CHAR)); |
Member
Author
There was a problem hiding this comment.
Ah, no good reason. Perhaps I tried to unify this with the code for STRINGLIB_SIZEOF_CHAR != 1.
zhangyangyu
reviewed
Mar 29, 2017
| p++; | ||
| } | ||
| } | ||
| return -1; |
Member
There was a problem hiding this comment.
How about assert(e - p <= MEMCHR_CUT_OFF) here?
Member
Author
There was a problem hiding this comment.
It is obvious if use a do-while loop.
Member
There was a problem hiding this comment.
Ohh, yes. I comment with the previous code.
…ves' into bpo-24821-find-char-false-positives
zhangyangyu
approved these changes
Mar 29, 2017
jaraco
pushed a commit
that referenced
this pull request
Dec 2, 2022
Bumps [redis](https://github.com/redis/redis-py) from 3.5.3 to 4.1.0. - [Release notes](https://github.com/redis/redis-py/releases) - [Changelog](https://github.com/redis/redis-py/blob/master/CHANGES) - [Commits](redis/redis-py@3.5.3...v4.1.0) --- updated-dependencies: - dependency-name: redis dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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.
unlucky Unicode characters.