Skip to content

Commit

Permalink
fix details
Browse files Browse the repository at this point in the history
Signed-off-by: martinvuyk <[email protected]>
  • Loading branch information
martinvuyk committed Dec 11, 2024
1 parent 4b7c0f1 commit 40b2017
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stdlib/src/utils/string_slice.mojo
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ struct StringSlice[is_mutable: Bool, //, origin: Origin[is_mutable]](
Returns:
The offset of `substr` relative to the beginning of the string.
"""
if not substr:
if substr.byte_length() == 0:
return 0

if self.byte_length() < substr.byte_length() + start:
Expand Down Expand Up @@ -936,7 +936,7 @@ struct StringSlice[is_mutable: Bool, //, origin: Origin[is_mutable]](
Returns:
The offset of `substr` relative to the beginning of the string.
"""
if not substr:
if substr.byte_length() == 0:
return self.byte_length()

if self.byte_length() < substr.byte_length() + start:
Expand Down

0 comments on commit 40b2017

Please sign in to comment.