Skip to content

Commit 8cf18dc

Browse files
committed
Clean up the uuid/i64_to_hex function
1 parent 2a79d02 commit 8cf18dc

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

uuid.pyx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,11 @@ _hextable[:] = [
2828

2929

3030
cdef inline char i64_to_hex(uint64_t num, char *s):
31-
cdef:
32-
char i = 15
33-
char ch
31+
cdef uint8_t i
3432

35-
while i >= 0:
36-
s[<uint8_t>i] = _hexmap[num & 0x0F]
33+
for i in range(15, -1, -1):
34+
s[i] = _hexmap[num & 0x0F]
3735
num >>= 4
38-
i -= 1
3936

4037
return 0
4138

0 commit comments

Comments
 (0)