File tree Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -75,17 +75,8 @@ class Submission {
7575 const std::vector<std::pair<hash, location_in_submission>> & getHashes () const { return hashes; }
7676
7777 void addSuspiciousMatch (location_in_submission location, const HashLocation &matching_location, hash matched_hash) {
78- std::map<location_in_submission, std::set<HashLocation>>::iterator itr = suspicious_matches.find (location);
79- // TODO: is this if-else necessary? would this not work if we just did?: suspicious_matches[location].insert(matching_location);
80- if (itr != suspicious_matches.end ()) {
81- // location already exists in the map, so we just append the location to the set
82- suspicious_matches[location].insert (matching_location);
83- } else {
84- // intialize the set and add the location
85- std::set<HashLocation> s;
86- s.insert (matching_location);
87- suspicious_matches[location] = s;
88- }
78+ // save the found match
79+ suspicious_matches[location].insert (matching_location);
8980 // update the students_matched container
9081 students_matched[matching_location.source_gradeable ][matching_location.student ][matching_location.version ].insert (matched_hash);
9182 }
You can’t perform that action at this time.
0 commit comments