diff options
| author | Martin Ridgers <[email protected]> | 2024-09-12 15:26:29 +0200 |
|---|---|---|
| committer | Martin Ridgers <[email protected]> | 2024-09-19 15:26:13 +0200 |
| commit | 93c3e6943eb236a8c76d11978c9ce1ceba48632a (patch) | |
| tree | 73e0bb79085d2029b3f074208611f375577f288f /src | |
| parent | Forgot there was a std::clamp (diff) | |
| download | zen-93c3e6943eb236a8c76d11978c9ce1ceba48632a.tar.xz zen-93c3e6943eb236a8c76d11978c9ce1ceba48632a.zip | |
Appease Apple Clang's historical lack of std::span constructors
Diffstat (limited to 'src')
| -rw-r--r-- | src/zenserver/projectstore/projectstore.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/zenserver/projectstore/projectstore.cpp b/src/zenserver/projectstore/projectstore.cpp index 0e1fb2e9a..f4ad869aa 100644 --- a/src/zenserver/projectstore/projectstore.cpp +++ b/src/zenserver/projectstore/projectstore.cpp @@ -2062,17 +2062,13 @@ ProjectStore::Oplog::IterateOplogLocked(std::function<void(CbObjectView)>&& Hand return Lhs.Offset < Rhs.Offset; }); - std::span<OplogEntryAddress> EntrySpan; + std::span<OplogEntryAddress> EntrySpan = Entries; if (EntryPaging != nullptr) { int32_t Size = int32_t(Entries.size()); int32_t Start = std::clamp(EntryPaging->Start, 0, Size); int32_t End = std::clamp(EntryPaging->Start + EntryPaging->Count, 0, Size); - EntrySpan = decltype(EntrySpan)(Entries.begin() + Start, End - Start); - } - else - { - EntrySpan = Entries; + EntrySpan = EntrySpan.subspan(Start, End - Start); } m_Storage->ReplayLogEntries(EntrySpan, [&](CbObjectView Op) { Handler(Op); }); |