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 7, 2024
1 parent 5a0ed66 commit cec5e63
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions stdlib/src/utils/string_slice.mojo
Original file line number Diff line number Diff line change
Expand Up @@ -1421,15 +1421,15 @@ fn _split_impl[
var sep_len = sep.byte_length()
if sep_len == 0:
var ptr = src_str.unsafe_ptr()
var iterator = _StringSliceIter[
_lit_mut_cast[False, __origin_of(src_str)].result
](unsafe_pointer=ptr, length=src_str.byte_length())
var iterator = _StringSliceIter[O](
unsafe_pointer=ptr, length=src_str.byte_length()
)
var i_len = len(iterator) + 2
var out_ptr = UnsafePointer[Span[Byte, O]].alloc(i_len)
out_ptr[0] = Span[Byte, O](ptr=ptr, length=0)
var i = 1
for s in iterator:
out_ptr[i] = rebind[Span[Byte, O]](s.as_bytes())
out_ptr[i] = s.as_bytes()
i += 1
out_ptr[i] = Span[Byte, O](ptr=ptr + i, length=0)
output = __type_of(output)(ptr=out_ptr, length=i_len, capacity=i_len)
Expand Down

0 comments on commit cec5e63

Please sign in to comment.