MCPcopy Create free account
hub / github.com/catboost/catboost / WriteVarUInt64

Function WriteVarUInt64

library/cpp/yson/varint.cpp:11–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9 ////////////////////////////////////////////////////////////////////////////////
10
11 int WriteVarUInt64(IOutputStream* output, ui64 value) {
12 bool stop = false;
13 int bytesWritten = 0;
14 while (!stop) {
15 ++bytesWritten;
16 ui8 byte = static_cast<ui8>(value | 0x80);
17 value >>= 7;
18 if (value == 0) {
19 stop = true;
20 byte &= 0x7F;
21 }
22 output->Write(byte);
23 }
24 return bytesWritten;
25 }
26
27 int WriteVarInt32(IOutputStream* output, i32 value) {
28 return WriteVarUInt64(output, static_cast<ui64>(ZigZagEncode32(value)));

Callers 3

OnUint64ScalarMethod · 0.85
WriteVarInt32Function · 0.85
WriteVarInt64Function · 0.85

Calls 1

WriteMethod · 0.45

Tested by

no test coverage detected