MCPcopy Index your code
hub / github.com/RustPython/RustPython / write_varint_with_start

Function write_varint_with_start

crates/compiler-core/src/varint.rs:57–63  ·  view source on GitHub ↗

Write a big-endian varint with the start marker (0x80) on the first byte.

(data: &mut Vec<u8>, val: u32)

Source from the content-addressed store, hash-verified

55
56/// Write a big-endian varint with the start marker (0x80) on the first byte.
57pub fn write_varint_with_start(data: &mut Vec<u8>, val: u32) {
58 let start_pos = data.len();
59 write_varint_be(data, val);
60 if let Some(first) = data.get_mut(start_pos) {
61 *first |= 0x80;
62 }
63}
64
65/// Read a big-endian varint with start marker (0x80).
66pub fn read_varint_with_start(data: &[u8], pos: &mut usize) -> Option<u32> {

Callers 2

encode_exception_tableFunction · 0.85

Calls 3

write_varint_beFunction · 0.85
get_mutMethod · 0.80
lenMethod · 0.45

Tested by 1