MCPcopy Create free account
hub / github.com/davidblewett/rure-python / write_vari32

Function write_vari32

regex/src/dfa.rs:1872–1878  ·  view source on GitHub ↗

https://developers.google.com/protocol-buffers/docs/encoding#varints

(data: &mut Vec<u8>, n: i32)

Source from the content-addressed store, hash-verified

1870
1871/// https://developers.google.com/protocol-buffers/docs/encoding#varints
1872fn write_vari32(data: &mut Vec<u8>, n: i32) {
1873 let mut un = (n as u32) << 1;
1874 if n < 0 {
1875 un = !un;
1876 }
1877 write_varu32(data, un)
1878}
1879
1880/// https://developers.google.com/protocol-buffers/docs/encoding#varints
1881fn read_vari32(data: &[u8]) -> (i32, usize) {

Callers 2

push_inst_ptrFunction · 0.85
pFunction · 0.85

Calls 1

write_varu32Function · 0.85

Tested by

no test coverage detected