diff options
| author | mzuenni <michi.zuendorf@gmail.com> | 2023-03-28 13:25:59 +0200 |
|---|---|---|
| committer | mzuenni <michi.zuendorf@gmail.com> | 2023-03-28 13:25:59 +0200 |
| commit | fe5fa1141efeb7454c763dbd2645fb4ff04487a3 (patch) | |
| tree | f2197bb94ce80ab2fae886177dfa9b0bd11538ac /datastructures/persistent.cpp | |
| parent | 3b91d2662310aee532cc84e1447824459671767e (diff) | |
merged
Diffstat (limited to 'datastructures/persistent.cpp')
| -rw-r--r-- | datastructures/persistent.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/datastructures/persistent.cpp b/datastructures/persistent.cpp index 1704ff2..0a65a79 100644 --- a/datastructures/persistent.cpp +++ b/datastructures/persistent.cpp @@ -7,12 +7,11 @@ struct persistent { : time(time), data(1, {time, value}) {}
T get(int t) {
- return prev(upper_bound(all(data),
- pair<int, T>(t+1, {})))->second;
+ return prev(upper_bound(all(data), {t+1, {}}))->second;
}
int set(T value) {
- time+=2;
+ time += 2;
data.push_back({time, value});
return time;
}
|
