Skip to content

Commit

Permalink
remove use of subtraction
Browse files Browse the repository at this point in the history
Signed-off-by: martinvuyk <[email protected]>
  • Loading branch information
martinvuyk committed Dec 19, 2024
1 parent 0a439e7 commit dce95e4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stdlib/src/utils/string_slice.mojo
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ fn _shift_unicode_to_utf8[
var mask = UInt8(0xFF) >> (num_bytes + int(num_bytes > 1))
var num_bytes_marker = UInt8(0xFF) << (8 - num_bytes)
ptr[0] = ((c >> shift) & mask) | (
num_bytes_marker & (int(num_bytes == 1) - 1)
num_bytes_marker & -int(num_bytes != 1)
)
for i in range(1, num_bytes):
shift -= 6
Expand Down

0 comments on commit dce95e4

Please sign in to comment.