1
0
mirror of synced 2025-01-19 01:24:15 +01:00

fix: Very inefficient iterating over static array patterns

Fixes #532
This commit is contained in:
WerWolv 2022-06-14 10:29:41 +02:00
parent dfc1dc2529
commit 653a688fe6
2 changed files with 4 additions and 4 deletions

@ -1 +1 @@
Subproject commit efaf1b20f117a09cd918905f04cdf18c0bae6f7f
Subproject commit 16b658dca695aad640e5a41bde067d2cfa75c058

View File

@ -7,8 +7,8 @@
namespace hex {
template<typename T>
concept ArrayPattern = requires(T pattern, std::function<void(int, pl::Pattern&)> fn) {
{ pattern.forEachArrayEntry(fn) } -> std::same_as<void>;
concept ArrayPattern = requires(u64 displayEnd, T pattern, std::function<void(int, pl::Pattern&)> fn) {
{ pattern.forEachArrayEntry(displayEnd, fn) } -> std::same_as<void>;
};
class PatternDrawer : public pl::PatternVisitor {
@ -48,7 +48,7 @@ namespace hex {
if (opened) {
auto& displayEnd = this->getDisplayEnd(pattern);
pattern.forEachArrayEntry([&] (u64 idx, auto &entry){
pattern.forEachArrayEntry(displayEnd, [&] (u64 idx, auto &entry){
this->drawArrayNode(idx, displayEnd, entry);
});
}