MCPcopy Create free account
hub / github.com/FuzzAnything/PromptFuzz / update_unique_branches

Method update_unique_branches

src/program/mod.rs:209–219  ·  view source on GitHub ↗

Update the unique branches according the new coverage

(&mut self, coming_branches: &HashMap<String, Vec<Branch>>)

Source from the content-addressed store, hash-verified

207
208 // Update the unique branches according the new coverage
209 pub fn update_unique_branches(&mut self, coming_branches: &HashMap<String, Vec<Branch>>) {
210 for unique_branch in self.quality.unique_branches.iter_mut() {
211 let (func, branches) = unique_branch;
212 if let Some(coming_func_branches) = coming_branches.get(func) {
213 branches.retain(|branch| !coming_func_branches.contains(branch));
214 }
215 }
216 self.quality
217 .unique_branches
218 .retain(|_, value| !value.is_empty());
219 }
220
221 pub fn set_unique_branches(&mut self, unique_branches: HashMap<String, Vec<Branch>>) {
222 self.quality.unique_branches = unique_branches

Callers 1

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected