mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-10 13:04:15 -04:00
fix: don't forward repeatedly
This commit is contained in:
parent
f4d87ee868
commit
0cf59df603
@ -92,7 +92,7 @@ class contextual_option {
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
bool any_is(T&& pred) const {
|
bool any_is(T&& pred) const {
|
||||||
for (auto e : contextual_) {
|
for (auto e : contextual_) {
|
||||||
if (std::forward<T>(pred)(e.second)) {
|
if (pred(e.second)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -102,7 +102,7 @@ class contextual_option {
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
void visit_contextual(T&& visitor) const {
|
void visit_contextual(T&& visitor) const {
|
||||||
for (auto const& [ctx, val] : contextual_) {
|
for (auto const& [ctx, val] : contextual_) {
|
||||||
std::forward<T>(visitor)(ctx, val);
|
visitor(ctx, val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -384,7 +384,7 @@ class inode_ : public inode {
|
|||||||
void scan_range(mmif* mm, scanner_progress* sprog, size_t offset, size_t size,
|
void scan_range(mmif* mm, scanner_progress* sprog, size_t offset, size_t size,
|
||||||
size_t chunk_size, T&& scanner) {
|
size_t chunk_size, T&& scanner) {
|
||||||
while (size >= chunk_size) {
|
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
|
// release_until() is best-effort, we can ignore the return value
|
||||||
// NOLINTNEXTLINE(bugprone-unused-return-value)
|
// NOLINTNEXTLINE(bugprone-unused-return-value)
|
||||||
mm->release_until(offset);
|
mm->release_until(offset);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user