File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -134,23 +134,20 @@ cdef class PgBaseUUID:
134
134
def __str__ (self ):
135
135
cdef:
136
136
uint64_t u
137
- char buf[16 ]
138
137
char out[36 ]
139
138
140
139
u = < uint64_t> hton.unpack_int64(self ._data)
141
- i64_to_hex(u, buf)
142
- memcpy(out, buf, 8 )
140
+ i64_to_hex(u, out)
141
+ u = < uint64_t> hton.unpack_int64(self ._data + 8 )
142
+ i64_to_hex(u, out + 20 )
143
+
144
+ memcpy(out + 14 , out + 12 , 4 )
145
+ memcpy(out + 9 , out + 8 , 4 )
146
+ memcpy(out + 19 , out + 20 , 4 )
143
147
out[8 ] = b' -'
144
- memcpy(out + 9 , buf + 8 , 4 )
145
148
out[13 ] = b' -'
146
- memcpy(out + 14 , buf + 12 , 4 )
147
149
out[18 ] = b' -'
148
-
149
- u = < uint64_t> hton.unpack_int64(self ._data + 8 )
150
- i64_to_hex(u, buf)
151
- memcpy(out + 19 , buf, 4 )
152
150
out[23 ] = b' -'
153
- memcpy(out + 24 , buf + 4 , 12 )
154
151
155
152
return cpythonx.PyUnicode_FromKindAndData(
156
153
cpythonx.PyUnicode_1BYTE_KIND, < void * > out, 36 )
You can’t perform that action at this time.
0 commit comments