MCPcopy Create free account
hub / github.com/QMHTMY/RustBook / len

Method len

code/chapter05/hashmap.rs:128–137  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

126 }
127
128 fn len(&self) -> usize {
129 let mut length = 0;
130 for d in self.slot.iter() {
131 if &0 != d { // 槽数据不为 0,表示有数据,length 加 1
132 length += 1;
133 }
134 }
135
136 length
137 }
138}
139
140fn main() {

Callers 9

interpolation_searchFunction · 0.45
sequential_searchFunction · 0.45
sequential_search_posFunction · 0.45
binary_search1Function · 0.45
binary_search2Function · 0.45
binary_searchFunction · 0.45
exponential_searchFunction · 0.45

Calls 1

iterMethod · 0.45

Tested by

no test coverage detected