Skip to content

Commit d681cfb

Browse files
committed
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.
1 parent 32b2928 commit d681cfb

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lib/include/pl/patterns/pattern_bitfield.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,10 @@ namespace pl::ptrn {
712712
} else if (auto *bitfield = dynamic_cast<PatternBitfield *>(pattern.get()); bitfield != nullptr) {
713713
valueString += fmt::format("{} = {} | ", bitfield->getVariableName(), bitfield->formatDisplayValue());
714714
}
715+
716+
if(valueString.size() - 3 > 64) {
717+
break;
718+
}
715719
}
716720

717721
if (valueString.size() >= 3) {

0 commit comments

Comments
 (0)