| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:caab60cf-2193-bcb7-4403-055ad8c487d3 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9150:28AE23:103F7AF:166A4DA:696A95DC |
| html-safe-nonce | 9bbc82fda40334d7710fbcffdc70245b7c8b05da07beb7ed63d8c72e47136cf8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MTUwOjI4QUUyMzoxMDNGN0FGOjE2NkE0REE6Njk2QTk1REMiLCJ2aXNpdG9yX2lkIjoiODM2OTk4Nzc2ODA1NzIzOTAwNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a5db98a43ca3f1b29b63606b34fb6e339f696db086ef959f836310cc6658f266 |
| hovercard-subject-tag | pull_request:508621503 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | ///pull_requests/show/files |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/22904/files |
| twitter:image | https://avatars.githubusercontent.com/u/36520290?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/36520290?s=400&v=4 |
| og:image:alt | https://bugs.python.org/issue41972 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4dd496afc954da9c207b2d9fbe86e3074619f565754aa1d9274aec30d9e5b8d7 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 31496a13b80a2f6ad77d6c617ee2255a3545b539 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| Skip to content | https://github.com/python/cpython/pull/22904/files#start-of-content |
|
| https://github.com/ |
|
Sign in
| https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F22904%2Ffiles |
| GitHub CopilotWrite better code with AI | https://github.com/features/copilot |
| GitHub SparkBuild and deploy intelligent apps | https://github.com/features/spark |
| GitHub ModelsManage and compare prompts | https://github.com/features/models |
| MCP RegistryNewIntegrate external tools | https://github.com/mcp |
| ActionsAutomate any workflow | https://github.com/features/actions |
| CodespacesInstant dev environments | https://github.com/features/codespaces |
| IssuesPlan and track work | https://github.com/features/issues |
| Code ReviewManage code changes | https://github.com/features/code-review |
| GitHub Advanced SecurityFind and fix vulnerabilities | https://github.com/security/advanced-security |
| Code securitySecure your code as you build | https://github.com/security/advanced-security/code-security |
| Secret protectionStop leaks before they start | https://github.com/security/advanced-security/secret-protection |
| Why GitHub | https://github.com/why-github |
| Documentation | https://docs.github.com |
| Blog | https://github.blog |
| Changelog | https://github.blog/changelog |
| Marketplace | https://github.com/marketplace |
| View all features | https://github.com/features |
| Enterprises | https://github.com/enterprise |
| Small and medium teams | https://github.com/team |
| Startups | https://github.com/enterprise/startups |
| Nonprofits | https://github.com/solutions/industry/nonprofits |
| App Modernization | https://github.com/solutions/use-case/app-modernization |
| DevSecOps | https://github.com/solutions/use-case/devsecops |
| DevOps | https://github.com/solutions/use-case/devops |
| CI/CD | https://github.com/solutions/use-case/ci-cd |
| View all use cases | https://github.com/solutions/use-case |
| Healthcare | https://github.com/solutions/industry/healthcare |
| Financial services | https://github.com/solutions/industry/financial-services |
| Manufacturing | https://github.com/solutions/industry/manufacturing |
| Government | https://github.com/solutions/industry/government |
| View all industries | https://github.com/solutions/industry |
| View all solutions | https://github.com/solutions |
| AI | https://github.com/resources/articles?topic=ai |
| Software Development | https://github.com/resources/articles?topic=software-development |
| DevOps | https://github.com/resources/articles?topic=devops |
| Security | https://github.com/resources/articles?topic=security |
| View all topics | https://github.com/resources/articles |
| Customer stories | https://github.com/customer-stories |
| Events & webinars | https://github.com/resources/events |
| Ebooks & reports | https://github.com/resources/whitepapers |
| Business insights | https://github.com/solutions/executive-insights |
| GitHub Skills | https://skills.github.com |
| Documentation | https://docs.github.com |
| Customer support | https://support.github.com |
| Community forum | https://github.com/orgs/community/discussions |
| Trust center | https://github.com/trust-center |
| Partners | https://github.com/partners |
| GitHub SponsorsFund open source developers | https://github.com/sponsors |
| Security Lab | https://securitylab.github.com |
| Maintainer Community | https://maintainers.github.com |
| Accelerator | https://github.com/accelerator |
| Archive Program | https://archiveprogram.github.com |
| Topics | https://github.com/topics |
| Trending | https://github.com/trending |
| Collections | https://github.com/collections |
| Enterprise platformAI-powered developer platform | https://github.com/enterprise |
| GitHub Advanced SecurityEnterprise-grade security features | https://github.com/security/advanced-security |
| Copilot for BusinessEnterprise-grade AI features | https://github.com/features/copilot/copilot-business |
| Premium SupportEnterprise-grade 24/7 support | https://github.com/premium-support |
| Pricing | https://github.com/pricing |
| Search syntax tips | https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax |
| documentation | https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax |
|
Sign in
| https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F22904%2Ffiles |
|
Sign up
| https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python%2Fcpython |
| Reload | https://github.com/python/cpython/pull/22904/files |
| Reload | https://github.com/python/cpython/pull/22904/files |
| Reload | https://github.com/python/cpython/pull/22904/files |
|
python
| https://github.com/python |
| cpython | https://github.com/python/cpython |
| Please reload this page | https://github.com/python/cpython/pull/22904/files |
|
Notifications
| https://github.com/login?return_to=%2Fpython%2Fcpython |
|
Fork
33.9k
| https://github.com/login?return_to=%2Fpython%2Fcpython |
|
Star
71.1k
| https://github.com/login?return_to=%2Fpython%2Fcpython |
|
Code
| https://github.com/python/cpython |
|
Issues
5k+
| https://github.com/python/cpython/issues |
|
Pull requests
2.1k
| https://github.com/python/cpython/pulls |
|
Actions
| https://github.com/python/cpython/actions |
|
Projects
31
| https://github.com/python/cpython/projects |
|
Security
Uh oh!
There was an error while loading. Please reload this page.
| https://github.com/python/cpython/security |
| Please reload this page | https://github.com/python/cpython/pull/22904/files |
|
Insights
| https://github.com/python/cpython/pulse |
|
Code
| https://github.com/python/cpython |
|
Issues
| https://github.com/python/cpython/issues |
|
Pull requests
| https://github.com/python/cpython/pulls |
|
Actions
| https://github.com/python/cpython/actions |
|
Projects
| https://github.com/python/cpython/projects |
|
Security
| https://github.com/python/cpython/security |
|
Insights
| https://github.com/python/cpython/pulse |
| Sign up for GitHub
| https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose |
| terms of service | https://docs.github.com/terms |
| privacy statement | https://docs.github.com/privacy |
| Sign in | https://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose |
| tim-one | https://github.com/tim-one |
| python:master | https://github.com/python/cpython/tree/master |
| sweeneyde:two-way-2 | https://github.com/sweeneyde/cpython/tree/two-way-2 |
|
Conversation
11
| https://github.com/python/cpython/pull/22904 |
|
Commits
19
| https://github.com/python/cpython/pull/22904/commits |
|
Checks
0
| https://github.com/python/cpython/pull/22904/checks |
|
Files changed
| https://github.com/python/cpython/pull/22904/files |
| Please reload this page | https://github.com/python/cpython/pull/22904/files |
|
bpo-41972: Use the two-way algorithm for string searching
| https://github.com/python/cpython/pull/22904/files#top |
|
Show all changes
19 commits
| https://github.com/python/cpython/pull/22904/files |
|
9da8642
fix typo
sweeneyde Oct 17, 2020
| https://github.com/python/cpython/pull/22904/commits/9da86426980af3f11ca36d6b28624f278fd38f42 |
|
da70219
initial implementation
sweeneyde Oct 21, 2020
| https://github.com/python/cpython/pull/22904/commits/da70219666e427cbf0ceb33554a9536896d16735 |
|
9062e6d
Add count and find functions
sweeneyde Oct 21, 2020
| https://github.com/python/cpython/pull/22904/commits/9062e6d30575cf440656a549a59792304087e3c7 |
|
d0d820a
add jump table
sweeneyde Oct 22, 2020
| https://github.com/python/cpython/pull/22904/commits/d0d820aa97bbba08f1a12c13467bd6de21774d7d |
|
bab1833
Add cutoff
sweeneyde Oct 22, 2020
| https://github.com/python/cpython/pull/22904/commits/bab1833ce31576394b224ebbd05bccb88703940f |
|
bf26486
Add test cases
sweeneyde Oct 22, 2020
| https://github.com/python/cpython/pull/22904/commits/bf26486456b93da62a67d9908e5a65ae1a77a6d4 |
|
bf15339
📜🤖 Added by blurb_it.
blurb-it[bot] Oct 23, 2020
| https://github.com/python/cpython/pull/22904/commits/bf15339e2af2f6dbdfbb1fdb2ea05e2ff879e03b |
|
f5afc66
Add safe downcasting to shift table initialization
sweeneyde Oct 24, 2020
| https://github.com/python/cpython/pull/22904/commits/f5afc66ee726b18e01edb9c8cb186e45365f1280 |
|
ed56aa0
More precise comment
sweeneyde Oct 24, 2020
| https://github.com/python/cpython/pull/22904/commits/ed56aa0e384e061238bd11febb3459e795c1bf9c |
|
f469766
code cleanups, increment a 'window' pointer rather than an index
sweeneyde Oct 24, 2020
| https://github.com/python/cpython/pull/22904/commits/f4697667341e63bf27824bb2fbae05e7bf9318b5 |
|
fe9e9d9
Fix sequence point warning; test cases to meet threshold
sweeneyde Oct 25, 2020
| https://github.com/python/cpython/pull/22904/commits/fe9e9d9c1f1c5f98c797d19e2214d1413701f6de |
|
40d5217
Tighter inner loop; precompute the table
sweeneyde Nov 2, 2020
| https://github.com/python/cpython/pull/22904/commits/40d5217d37bb85f7eaa1cae90f54a3578aaddd82 |
|
a3c453d
Revert "Tighter inner loop; precompute the table"
sweeneyde Nov 2, 2020
| https://github.com/python/cpython/pull/22904/commits/a3c453d2530da8215c13fdedc433dbce9d84d35f |
|
5e82212
m cutoff to 100, n-m cutoff to 5000
sweeneyde Nov 7, 2020
| https://github.com/python/cpython/pull/22904/commits/5e82212784b02accf7c07eff58ae640540d3ac37 |
|
5be10c7
Improve comments, always use memory in periodic case, and remove the …
sweeneyde Jan 17, 2021
| https://github.com/python/cpython/pull/22904/commits/5be10c7b4b16d9ff74c7ce5d8e987c797726919c |
|
1801253
Make the algorithm adaptive
sweeneyde Jan 17, 2021
| https://github.com/python/cpython/pull/22904/commits/180125318757db709c86cdba5aee982495f155de |
|
8fb8979
Add notes text document
sweeneyde Jan 17, 2021
| https://github.com/python/cpython/pull/22904/commits/8fb897949e3c5f7e35c1e9d1ca65e04ddb0831c2 |
|
e616bee
skip starts at mlast
sweeneyde Jan 17, 2021
| https://github.com/python/cpython/pull/22904/commits/e616bee3bc27420e713cf76f4343d80328c30d3e |
|
b63e7dc
Refactor to use for-loops, single cache-line table
sweeneyde Feb 27, 2021
| https://github.com/python/cpython/pull/22904/commits/b63e7dc77f32e424a36e01ed229202574257cd1d |
|
Clear filters
| https://github.com/python/cpython/pull/22904/files |
| Please reload this page | https://github.com/python/cpython/pull/22904/files |
| Please reload this page | https://github.com/python/cpython/pull/22904/files |
|
string_tests.py
| https://github.com/python/cpython/pull/22904/files#diff-7d8595e2ffcdcbf3222473c387d3f3da8344cfccd6e460dba3e726d2220ab0a7 |
|
2020-10-23-23-17-23.bpo-41972.kbAwg4.rst
| https://github.com/python/cpython/pull/22904/files#diff-406ba0a5c686b4e9cc7b09ea0b8d176f64f9ca26a3834b204522f688dc29cc42 |
|
fastsearch.h
| https://github.com/python/cpython/pull/22904/files#diff-67ae1b84396bc0119774489a3e62be151a8e1b1317a63c540f976d57d3e0489d |
|
stringlib_find_two_way_notes.txt
| https://github.com/python/cpython/pull/22904/files#diff-b297ca100d805065001b4686764f9b4e6380680256dc66c830f8452a751d64ad |
| Lib/test/string_tests.py | https://github.com/python/cpython/pull/22904/files#diff-7d8595e2ffcdcbf3222473c387d3f3da8344cfccd6e460dba3e726d2220ab0a7 |
|
View file
| https://github.com/sweeneyde/cpython/blob/b63e7dc77f32e424a36e01ed229202574257cd1d/Lib/test/string_tests.py |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/python/cpython/pull/22904/{{ revealButtonHref }} |
|
| https://github.com/python/cpython/pull/22904/files#diff-7d8595e2ffcdcbf3222473c387d3f3da8344cfccd6e460dba3e726d2220ab0a7 |
|
| https://github.com/python/cpython/pull/22904/files#diff-7d8595e2ffcdcbf3222473c387d3f3da8344cfccd6e460dba3e726d2220ab0a7 |
|
| https://github.com/python/cpython/pull/22904/files#diff-7d8595e2ffcdcbf3222473c387d3f3da8344cfccd6e460dba3e726d2220ab0a7 |
|
| https://github.com/python/cpython/pull/22904/files#diff-7d8595e2ffcdcbf3222473c387d3f3da8344cfccd6e460dba3e726d2220ab0a7 |
| Misc/NEWS.d/next/Core and Builtins/2020-10-23-23-17-23.bpo-41972.kbAwg4.rst | https://github.com/python/cpython/pull/22904/files#diff-406ba0a5c686b4e9cc7b09ea0b8d176f64f9ca26a3834b204522f688dc29cc42 |
|
View file
| https://github.com/sweeneyde/cpython/blob/b63e7dc77f32e424a36e01ed229202574257cd1d/Misc/NEWS.d/next/Core%20and%20Builtins/2020-10-23-23-17-23.bpo-41972.kbAwg4.rst |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/python/cpython/pull/22904/{{ revealButtonHref }} |
| Please reload this page | https://github.com/python/cpython/pull/22904/files |
|
| https://github.com |
| Terms | https://docs.github.com/site-policy/github-terms/github-terms-of-service |
| Privacy | https://docs.github.com/site-policy/privacy-policies/github-privacy-statement |
| Security | https://github.com/security |
| Status | https://www.githubstatus.com/ |
| Community | https://github.community/ |
| Docs | https://docs.github.com/ |
| Contact | https://support.github.com?tags=dotcom-footer |