From d681cfbfc65e1400aefcb152870dee723fc8b063 Mon Sep 17 00:00:00 2001 From: Aki <75532970+AkiSakurai@users.noreply.github.com> Date: Sat, 6 Dec 2025 17:11:03 +0800 Subject: [PATCH 1/2] Early termination of formatDisplayValue for bitfield When you have a rather large recursively defined bitfield, the UI can hang for a while. This commit makes it stop early when the string reaches 64 characters. --- lib/include/pl/patterns/pattern_bitfield.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/include/pl/patterns/pattern_bitfield.hpp b/lib/include/pl/patterns/pattern_bitfield.hpp index 523ec19f..90fc9c6a 100644 --- a/lib/include/pl/patterns/pattern_bitfield.hpp +++ b/lib/include/pl/patterns/pattern_bitfield.hpp @@ -712,6 +712,10 @@ namespace pl::ptrn { } else if (auto *bitfield = dynamic_cast(pattern.get()); bitfield != nullptr) { valueString += fmt::format("{} = {} | ", bitfield->getVariableName(), bitfield->formatDisplayValue()); } + + if(valueString.size() - 3 > 64) { + break; + } } if (valueString.size() >= 3) { From ee363086de95c6197c4be8590f8f54e5ee4ad2ab Mon Sep 17 00:00:00 2001 From: Aki Sakurai <75532970+AkiSakurai@users.noreply.github.com> Date: Sat, 6 Dec 2025 20:25:05 +0800 Subject: [PATCH 2/2] Fix formatting style for conditional check --- lib/include/pl/patterns/pattern_bitfield.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/include/pl/patterns/pattern_bitfield.hpp b/lib/include/pl/patterns/pattern_bitfield.hpp index 90fc9c6a..f2b93a94 100644 --- a/lib/include/pl/patterns/pattern_bitfield.hpp +++ b/lib/include/pl/patterns/pattern_bitfield.hpp @@ -713,7 +713,7 @@ namespace pl::ptrn { valueString += fmt::format("{} = {} | ", bitfield->getVariableName(), bitfield->formatDisplayValue()); } - if(valueString.size() - 3 > 64) { + if (valueString.size() - 3 > 64) { break; } } @@ -814,4 +814,4 @@ namespace pl::ptrn { bool m_reversed = false; }; -} \ No newline at end of file +}