summaryrefslogtreecommitdiff
path: root/datastructures/persistent.cpp
diff options
context:
space:
mode:
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;
}