fix: don't forward repeatedly

This commit is contained in:
Marcus Holland-Moritz 2025-03-15 23:57:45 +01:00
parent f4d87ee868
commit 0cf59df603
2 changed files with 3 additions and 3 deletions

View File

@ -92,7 +92,7 @@ class contextual_option {
template <typename T>
bool any_is(T&& pred) const {
for (auto e : contextual_) {
if (std::forward<T>(pred)(e.second)) {
if (pred(e.second)) {
return true;
}
}
@ -102,7 +102,7 @@ class contextual_option {
template <typename T>
void visit_contextual(T&& visitor) const {
for (auto const& [ctx, val] : contextual_) {
std::forward<T>(visitor)(ctx, val);
visitor(ctx, val);
}
}

View File

@ -384,7 +384,7 @@ class inode_ : public inode {
void scan_range(mmif* mm, scanner_progress* sprog, size_t offset, size_t size,
size_t chunk_size, T&& scanner) {
while (size >= chunk_size) {
std::forward<T>(scanner)(mm->span(offset, chunk_size));
scanner(mm->span(offset, chunk_size));
// release_until() is best-effort, we can ignore the return value
// NOLINTNEXTLINE(bugprone-unused-return-value)
mm->release_until(offset);