Skip to content

Commit 70570e1

Browse files
authored
Update sequentially-ordinal-rank-tracker.cpp
1 parent bb74520 commit 70570e1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

C++/sequentially-ordinal-rank-tracker.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ class SORTracker {
88

99
}
1010
void add(string name, int score) {
11-
auto cit1 = s.emplace(-score, name).first;
12-
if (cit == cend(s) || *cit1 < *cit) {
13-
--cit;
11+
auto cit1 = lookup_.emplace(-score, name).first;
12+
if (cit_ == cend(lookup_) || *cit1 < *cit_) {
13+
--cit_;
1414
}
1515
}
1616

1717
string get() {
18-
return (cit++)->second;
18+
return (cit_++)->second;
1919
}
2020

2121
private:
22-
set<pair<int, string>> s;
23-
set<pair<int, string>>::const_iterator cit = cend(s);
22+
set<pair<int, string>> lookup_;
23+
set<pair<int, string>>::const_iterator cit_ = cend(lookup_);
2424
};

0 commit comments

Comments
 (0)