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

Function skip_whitespace

crates/stdlib/src/json.rs:24–34  ·  view source on GitHub ↗
(bytes: &[u8])

Source from the content-addressed store, hash-verified

22 /// Since all JSON whitespace chars are ASCII, bytes == chars.
23 #[inline]
24 fn skip_whitespace(bytes: &[u8]) -> usize {
25 flame_guard!("_json::skip_whitespace");
26 let mut count = 0;
27 for &b in bytes {
28 match b {
29 b' ' | b'\t' | b'\n' | b'\r' => count += 1,
30 _ => break,
31 }
32 }
33 count
34 }
35
36 /// Check if a byte slice starts with a given ASCII pattern.
37 #[inline]

Callers 2

parse_objectMethod · 0.85
parse_arrayMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected