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

Method add

regex/src/dfa.rs:1691–1698  ·  view source on GitHub ↗

Allocates room for one additional state and returns a pointer to it. If there's no more room, None is returned.

(&mut self)

Source from the content-addressed store, hash-verified

1689 ///
1690 /// If there's no more room, None is returned.
1691 fn add(&mut self) -> Option<StatePtr> {
1692 let si = self.table.len();
1693 if si > STATE_MAX as usize {
1694 return None;
1695 }
1696 self.table.extend(repeat(STATE_UNKNOWN).take(self.num_byte_classes));
1697 Some(usize_to_u32(si))
1698 }
1699
1700 /// Clears the table of all states.
1701 fn clear(&mut self) {

Callers 1

add_stateMethod · 0.45

Calls 2

usize_to_u32Function · 0.70
lenMethod · 0.45

Tested by

no test coverage detected