MCPcopy Create free account
hub / github.com/apache/arrow-rs / new

Method new

arrow-cast/src/parse.rs:50–61  ·  view source on GitHub ↗
(bytes: &[u8])

Source from the content-addressed store, hash-verified

48
49impl TimestampParser {
50 fn new(bytes: &[u8]) -> Self {
51 let mut digits = [0; 32];
52 let mut mask = 0;
53
54 // Treating all bytes the same way, helps LLVM vectorise this correctly
55 for (idx, (o, i)) in digits.iter_mut().zip(bytes).enumerate() {
56 *o = i.wrapping_sub(b'0');
57 mask |= ((*o < 10) as u32) << idx
58 }
59
60 Self { digits, mask }
61 }
62
63 /// Returns true if the byte at `idx` in the original string equals `b`
64 fn test(&self, idx: usize, b: u8) -> bool {

Callers

nothing calls this directly

Calls 2

zipMethod · 0.80
wrapping_subMethod · 0.45

Tested by

no test coverage detected