Skip to content

Commit

Permalink
make update return value directly
Browse files Browse the repository at this point in the history
  • Loading branch information
Coldwings committed Aug 12, 2024
1 parent 9416a1f commit 68e79f9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions common/objectcachev2.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ class ObjectCacheV2 {

std::shared_ptr<V> update(std::shared_ptr<V> r, uint64_t ts = 0) {
lastcreate = ts;
r = std::atomic_exchange(&ref, r);
return r;
return std::atomic_exchange(&ref, r);
}
std::shared_ptr<V> reset(uint64_t ts = 0) {
return update({nullptr}, ts);
Expand Down

0 comments on commit 68e79f9

Please sign in to comment.