@@ -68,14 +68,16 @@ bool ranking_sorter(const std::pair<Submission,float> &a, const std::pair<Submis
68
68
69
69
// ===================================================================================
70
70
// ===================================================================================
71
- void insert_others (std::map<Submission,std::set<int > > &others,
71
+ void insert_others (const std::string &this_username,
72
+ std::map<Submission,std::set<int > > &others,
72
73
const std::map<Submission,std::vector<Sequence> > &matches) {
73
74
for (std::map<Submission,std::vector<Sequence> >::const_iterator itr = matches.begin (); itr!=matches.end ();itr++) {
74
- // std::set<int> foo;
75
75
for (int i = 0 ; i < itr->second .size (); i++) {
76
+ // don't include matches to this username
77
+ if (this_username == itr->first .username )
78
+ continue ;
76
79
others[itr->first ].insert (itr->second [i].position );
77
80
}
78
- // .insert(std::make_pair(itr->first,foo));
79
81
}
80
82
}
81
83
@@ -259,10 +261,10 @@ int main(int argc, char* argv[]) {
259
261
int pos = (itr2 == itr->second .end ()) ? -1 : itr2->first ;
260
262
if (pos != -1 && range_start==-1 ) {
261
263
range_start = range_end = pos;
262
- insert_others (others,itr2->second );
264
+ insert_others (username, others,itr2->second );
263
265
} else if (pos != -1 && range_end+1 == pos) {
264
266
range_end = pos;
265
- insert_others (others,itr2->second );
267
+ insert_others (username, others,itr2->second );
266
268
} else if (range_start != -1 ) {
267
269
std::map<std::string,nlohmann::json> info_data;
268
270
info_data[" start" ]=nlohmann::json (range_start);
0 commit comments