-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve Entry placeholder resolution (#10846)
* Entry placeholder resolution: don't overdo it After resolving placeholders, previously the code would do it all over again if anything had changed, multiple times up to the recursion limit. This would have the effect of applying a much greater recursion limit, which is confusing and unnecessary, and probably undesired. * Entry tweaks and minor refactoring - Entry::size(): when computing tag size, use same delimiter set as in other places in the code - Factor tag delimiter set regex out into global constant - Placeholder resolution: remove unnecessary special casing for self-referential placeholders (these are taken care of by existing recursion depth limit) - Placeholder resolution: less wasteful string building loop - Move some constants from being public static data members of Entry to being local to Entry.cpp (in anonymous namespace) - Migrate some QRegEx instances to QRegularExpression, the modern alternative - Miscellanous minor code cleanups * Entry: fix hitting recursion limit with {braces} When encountering a {brace-enclosed} substring, the placeholder resolution logic would previously keep recursing until it hit the recursion depth limit (currently 10). This would lead to "Maximum depth of replacement has been reached" messages, and was also wasting CPU cycles. Fixes #1741 --------- Co-authored-by: Jonathan White <[email protected]>
- Loading branch information
1 parent
2c08448
commit da8874d
Showing
4 changed files
with
66 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters