Bug 8323 – std.string.chompPrefix does not handle differing string types properly

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-06-30T00:14:00Z
Last change time
2015-06-09T05:15:07Z
Assigned to
nobody
Creator
issues.dlang

Comments

Comment #0 by issues.dlang — 2012-06-30T00:14:27Z
This fails assert(equal(chompPrefix("\uFF28el\uFF4co", "\uFF28el\uFF4co"w), "")); This because chompPrefix is assuming that the two strings that it's given have the same character type even though it's templated to take two completely different character types.
Comment #1 by issues.dlang — 2012-07-01T01:44:56Z
Comment #2 by github-bugzilla — 2012-07-08T20:16:53Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/6203835e5d699f7a37c16625db0776870532761a Fix for issue# 8323. I decided to improve the documentation for some of std.string's functions and ended up optimizing their implementations as well (I benchmarked the new versions against the old versions, so they should definitely be faster). I also ran into bug# 8323, so I fixed it as well. https://github.com/D-Programming-Language/phobos/commit/8c747b0abac930c29cace48c9ca0fe48c04e628e Merge pull request #655 from jmdavis/string Fix for issue# 8323.
Comment #3 by github-bugzilla — 2012-07-08T20:20:02Z