MCPcopy Create free account
hub / github.com/e2wugui/zeze / write_long_size

Method write_long_size

python/zeze/buffer.py:357–378  ·  view source on GitHub ↗
(v)

Source from the content-addressed store, hash-verified

355
356 @staticmethod
357 def write_long_size(v):
358 # @formatter:off
359 if v >= 0:
360 if v < 0x40: return 1
361 if v < 0x2000: return 2
362 if v < 0x10_0000: return 3
363 if v < 0x800_0000: return 4
364 if v < 0x4_0000_0000: return 5
365 if v < 0x200_0000_0000: return 6
366 if v < 0x1_0000_0000_0000: return 7
367 if v < 0x80_0000_0000_0000: return 8
368 else:
369 if v >= - 0x40: return 1
370 if v >= - 0x2000: return 2
371 if v >= - 0x10_0000: return 3
372 if v >= - 0x800_0000: return 4
373 if v >= - 0x4_0000_0000: return 5
374 if v >= - 0x200_0000_0000: return 6
375 if v >= - 0x1_0000_0000_0000: return 7
376 if v >= -0x80_0000_0000_0000: return 8
377 return 9
378 # @formatter:on
379
380 def write_long(self, v):
381 if v >= 0:

Callers 2

check_intMethod · 0.80
check_longMethod · 0.80

Calls

no outgoing calls

Tested by 2

check_intMethod · 0.64
check_longMethod · 0.64