Result::Result(const Result& res, const HashSet<String>& IDs) { method = res.method; result_data_ = res.result_data_; description_ = res.description_; for (HashMap < String, vector < ResultData > > ::const_iterator it = res.result_data_.begin(); it != res.result_data_.end(); it++) { if (IDs.has(it->first)) result_data_.insert(*it); } for (HashMap < String, ResultData > ::const_iterator it = res.result_output_data_.begin(); it != res.result_output_data_.end(); it++) { if (IDs.has(it->first)) result_output_data_.insert(*it); } for (vector < String > ::const_iterator it = res.input_conformations_.begin(); it != res.input_conformations_.end(); it++) { if (IDs.has(*it)) input_conformations_.push_back(*it); } for (HashSet < String > ::const_iterator it = res.input_conformations_map_.begin(); it != res.input_conformations_map_.end(); it++) { if (IDs.has(*it)) input_conformations_map_.insert(*it); } }
static void MaybeTraceGroup(ObjectGroup *group) { if (tracedGroups.has(group)) return; MaybeTraceClass(group->clasp()); TraceEvent(TraceEventGroupInfo, uint64_t(group)); TraceAddress(group->clasp()); TraceInt(group->flags()); MOZ_ALWAYS_TRUE(tracedGroups.put(group)); }
static void MaybeTraceClass(const Class *clasp) { if (tracedClasses.has(clasp)) return; TraceEvent(TraceEventClassInfo, uint64_t(clasp)); TraceString(clasp->name); TraceInt(clasp->flags); TraceInt(clasp->finalize != nullptr); MOZ_ALWAYS_TRUE(tracedClasses.put(clasp)); }
static void MaybeTraceType(TypeObject *type) { if (tracedTypes.has(type)) return; MaybeTraceClass(type->clasp()); TraceEvent(TraceEventTypeInfo, uint64_t(type)); TraceAddress(type->clasp()); TraceInt(type->flags()); MOZ_ALWAYS_TRUE(tracedTypes.put(type)); }
hs.insert(0); hs.insert(1); hs.insert(2); hs2.insert(3); hs2.insert(4); hs2.insert(5); hs2.insert(6); hs2.insert(7); hs.swap(hs2); TEST_EQUAL(hs2.getSize(), 3) TEST_EQUAL(hs2.getCapacity(), 4) TEST_EQUAL(hs2.getBucketSize(), 3) TEST_EQUAL(hs2.has(0), true) TEST_EQUAL(hs2.has(3), false) TEST_EQUAL(hs.getSize(), 5) TEST_EQUAL(hs.getCapacity(), 7) TEST_EQUAL(hs.getBucketSize(), 7) TEST_EQUAL(hs.has(0), false) TEST_EQUAL(hs.has(3), true) RESULT CHECK(const HashSet& operator = (const HashSet& rhs) throw()) HashSet<int> hs, hs2; hs.insert(0); hs.insert(1); hs.insert(2); hs2 = hs;