Bug 18328 – algorithm.startsWith can compare narrow string lengths in more circumstances

Status
RESOLVED
Resolution
FIXED
Severity
trivial
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-01-30T02:23:59Z
Last change time
2018-01-30T15:30:44Z
Assigned to
No Owner
Creator
Nathan S.

Comments

Comment #0 by n8sh.secondary — 2018-01-30T02:23:59Z
algorithm.startsWith can check `haystack.length < needle.length` in more circumstances than it currently does when one or both of haystack/needle are narrow strings.
Comment #1 by n8sh.secondary — 2018-01-30T02:27:15Z
Comment #2 by github-bugzilla — 2018-01-30T15:30:43Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/b4ad39a8b62175ae895421ca24877793fa946ae5 Fix Issue 18328 - algorithm.startsWith can compare narrow string lengths in more circumstances https://github.com/dlang/phobos/commit/da731e632a2ab90ff4d04cf0ec417218bde46045 Merge pull request #6093 from n8sh/algorithm-startswith-length Fix Issue 18328 - algorithm.startsWith can compare narrow string leng…