mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-10-26 22:10:45 +00:00
[Rules] Make the escape/mask helpers static
hideEscaped(), hideMasked() and restoreMaskedAndEscaped() are only used in ESPEasyRules.cpp. With internal linkage GCC inlines them where they are called once (builds without FEATURE_EXTENDED_STRING_FUNCTIONS), so the ESP8266 build is the same size as before the previous commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0cf0b0df25
commit
f23953d428
1 file changed
+3
-3
@@ -507,7 +507,7 @@ enum class string_commands_e {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
void hideEscaped(String &line, bool &mustReplaceEscapedBracket, bool &mustReplaceEscapedCurlyBracket, bool &mustReplaceEscapedColon) {
|
static void hideEscaped(String &line, bool &mustReplaceEscapedBracket, bool &mustReplaceEscapedCurlyBracket, bool &mustReplaceEscapedColon) {
|
||||||
String MaskEscapedBracket;
|
String MaskEscapedBracket;
|
||||||
|
|
||||||
if (hasEscapedCharacter(line,'(') || hasEscapedCharacter(line,')')) {
|
if (hasEscapedCharacter(line,'(') || hasEscapedCharacter(line,')')) {
|
||||||
@@ -541,14 +541,14 @@ void hideEscaped(String &line, bool &mustReplaceEscapedBracket, bool &mustReplac
|
|||||||
#endif // if FEATURE_EXTENDED_STRING_FUNCTIONS
|
#endif // if FEATURE_EXTENDED_STRING_FUNCTIONS
|
||||||
}
|
}
|
||||||
|
|
||||||
void hideMasked(String &line, bool mustReplaceMaskedChars) {
|
static void hideMasked(String &line, bool mustReplaceMaskedChars) {
|
||||||
if (mustReplaceMaskedChars) {
|
if (mustReplaceMaskedChars) {
|
||||||
line.replace('{', static_cast<char>(0x02));
|
line.replace('{', static_cast<char>(0x02));
|
||||||
line.replace('}', static_cast<char>(0x03));
|
line.replace('}', static_cast<char>(0x03));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void restoreMaskedAndEscaped(String &line, bool mustReplaceMaskedChars, bool mustReplaceEscapedBracket, bool mustReplaceEscapedCurlyBracket, bool mustReplaceEscapedColon) {
|
static void restoreMaskedAndEscaped(String &line, bool mustReplaceMaskedChars, bool mustReplaceEscapedBracket, bool mustReplaceEscapedCurlyBracket, bool mustReplaceEscapedColon) {
|
||||||
String MaskEscapedBracket;
|
String MaskEscapedBracket;
|
||||||
|
|
||||||
if (mustReplaceMaskedChars) {
|
if (mustReplaceMaskedChars) {
|
||||||
|
|||||||
Reference in new issue
Block a user