MCPcopy Create free account
hub / github.com/csmith-project/csmith / renew_fact

Function renew_fact

src/Fact.cpp:187–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185}
186
187bool
188renew_fact(FactVec& facts, const Fact* new_fact)
189{
190 size_t i;
191 for (i=0; i<facts.size(); i++) {
192 if (new_fact->is_related(*facts[i])) {
193 if (new_fact->equal(*facts[i])) {
194 return false;
195 }
196 facts[i] = new_fact;
197 break;
198 }
199 }
200 // if not found, append the new fact
201 if (i==facts.size()) {
202 facts.push_back(new_fact);
203 }
204 return true;
205}
206
207bool
208merge_facts(FactVec& facts, const FactVec& new_facts)

Callers 2

renew_factsFunction · 0.85

Calls 3

sizeMethod · 0.80
is_relatedMethod · 0.80
equalMethod · 0.45

Tested by

no test coverage detected