Verified Commit 47c1a718 authored by Dmitry Volodin's avatar Dmitry Volodin
Browse files

Speed optimization

parent 0b358a0b
Pipeline #8132 passed with stages
in 6 minutes and 4 seconds
......@@ -147,8 +147,8 @@ def encode_oid(bytes msg):
cdef int v = 0
cdef int nv = 0
cdef int sn = 0
cdef char x
cdef char *ptr = msg
cdef unsigned char *ptr = msg
cdef unsigned char x
cdef char[1024] out
cdef char* o_ptr = out + 2
cdef int l_msg = len(msg)
......@@ -175,7 +175,7 @@ def encode_oid(bytes msg):
o_ptr = _write_int(o_ptr, v)
# Write length
out[1] = o_ptr - out - 2
return bytes(out[:o_ptr - out])
return out[:o_ptr - out]
cdef inline int _write_raw_int(char* ptr, int value):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment