MCPcopy Create free account
hub / github.com/apache/impala / GetVarint32PtrFallback

Function GetVarint32PtrFallback

be/src/kudu/util/coding.cc:62–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62const uint8_t *GetVarint32PtrFallback(const uint8_t *p,
63 const uint8_t *limit,
64 uint32_t* value) {
65 uint32_t result = 0;
66 for (uint32_t shift = 0; shift <= 28 && p < limit; shift += 7) {
67 uint32_t byte = *p;
68 p++;
69 if (byte & 128) {
70 // More bytes are present
71 result |= ((byte & 127) << shift);
72 } else {
73 result |= (byte << shift);
74 *value = result;
75 return p;
76 }
77 }
78 return nullptr;
79}
80
81bool GetVarint32(Slice* input, uint32_t* value) {
82 const uint8_t *p = input->data();

Callers 1

GetVarint32PtrFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected