summaryrefslogtreecommitdiff
path: root/datastructures/persistent.cpp
diff options
context:
space:
mode:
authormzuenni <michi.zuendorf@gmail.com>2023-03-28 13:25:59 +0200
committermzuenni <michi.zuendorf@gmail.com>2023-03-28 13:25:59 +0200
commitfe5fa1141efeb7454c763dbd2645fb4ff04487a3 (patch)
treef2197bb94ce80ab2fae886177dfa9b0bd11538ac /datastructures/persistent.cpp
parent3b91d2662310aee532cc84e1447824459671767e (diff)
merged
Diffstat (limited to 'datastructures/persistent.cpp')
-rw-r--r--datastructures/persistent.cpp5
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;
}