We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bb74520 commit 70570e1Copy full SHA for 70570e1
C++/sequentially-ordinal-rank-tracker.cpp
@@ -8,17 +8,17 @@ class SORTracker {
8
9
}
10
void add(string name, int score) {
11
- auto cit1 = s.emplace(-score, name).first;
12
- if (cit == cend(s) || *cit1 < *cit) {
13
- --cit;
+ auto cit1 = lookup_.emplace(-score, name).first;
+ if (cit_ == cend(lookup_) || *cit1 < *cit_) {
+ --cit_;
14
15
16
17
string get() {
18
- return (cit++)->second;
+ return (cit_++)->second;
19
20
21
private:
22
- set<pair<int, string>> s;
23
- set<pair<int, string>>::const_iterator cit = cend(s);
+ set<pair<int, string>> lookup_;
+ set<pair<int, string>>::const_iterator cit_ = cend(lookup_);
24
};
0 commit comments