MCPcopy Create free account
hub / github.com/NativeScript/android / VLQEncode

Function VLQEncode

test-app/runtime/src/main/cpp/v8_inspector/src/base/vlq.h:45–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43// process_byte function.
44template <typename Function>
45inline typename std::enable_if<
46 std::is_same<decltype(std::declval<Function>()(0)), byte*>::value,
47 void>::type
48VLQEncode(Function&& process_byte, int32_t value) {
49 // This wouldn't handle kMinInt correctly if it ever encountered it.
50 DCHECK_NE(value, std::numeric_limits<int32_t>::min());
51 bool is_negative = value < 0;
52 // Encode sign in least significant bit.
53 uint32_t bits = static_cast<uint32_t>((is_negative ? -value : value) << 1) |
54 static_cast<uint32_t>(is_negative);
55 VLQEncodeUnsigned(std::forward<Function>(process_byte), bits);
56}
57
58// Wrapper of VLQEncode for std::vector backed storage containers.
59template <typename A>

Callers

nothing calls this directly

Calls 2

VLQEncodeUnsignedFunction · 0.85
backMethod · 0.80

Tested by

no test coverage detected