Commit dce39943 authored by Tomas Krizek's avatar Tomas Krizek

dbhelper: use little endian uint as query key

parent 0f5c6d5d
......@@ -16,12 +16,11 @@ WireFormat = bytes
def qid2key(qid: QID) -> QKey:
"""Encode query ID to database key"""
return struct.pack('@I', qid) # native integer
return struct.pack('<I', qid)
def key2qid(key: QKey) -> QID:
return struct.unpack('@I', key)[0]
return struct.unpack('<I', key)[0]
class LMDB:
......
Markdown is supported
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