Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upSubslice search #54961
Comments
estebank
added
the
T-libs
label
Oct 10, 2018
This comment has been minimized.
This comment has been minimized.
Shnatsel
commented
Jan 12, 2019
This comment has been minimized.
This comment has been minimized.
Shnatsel
commented
Jan 12, 2019
|
At least there is a third-party crate based on stdlib implementation for strings: https://github.com/strake/subslice.rs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
leonardo-m commentedOct 10, 2018
•
edited
As enhancement, I think stdlib should contain functions that search a subslice inside a given slice:
For the common case of T:Copy items the true stdlib functions should specialize using a smarter algorithm, like:
https://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm
(Similar functions are useful for iterators too).