std.mem.indexOfPos should return start_index when needle length is zero #10216
Labels
bug
Observed behavior contradicts documented or intended behavior
contributor friendly
This issue is limited in scope and/or knowledge of Zig internals.
standard library
This issue involves writing Zig code for the standard library.
Milestone
Zig Version
0.9.0-dev.1712+9836f1b2f
Steps to Reproduce
Search for an empty slice inside another:
Expected Behavior
I expect an empty slice to be always found exactly at the specified start index.
Actual Behavior
The
indexOfPos
function always returns0
if the needle has no length.The text was updated successfully, but these errors were encountered: