mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-09-15 19:17:08 +00:00
[Cleanup] Use .clear() on strings instead of assigning empty string
This commit is contained in:
+1
-1
@@ -194,7 +194,7 @@ bool CPlugin_015(CPlugin::Function function, struct EventStruct *event, String&
|
||||
|
||||
if (!isvalid) {
|
||||
// send empty string to Blynk in case of error
|
||||
formattedValue = EMPTY_STRING;
|
||||
formattedValue.clear();
|
||||
}
|
||||
|
||||
String valueName = ExtraTaskSettings.TaskDeviceValueNames[x];
|
||||
|
||||
@@ -430,7 +430,7 @@ boolean Plugin_050(uint8_t function, struct EventStruct *event, String& string)
|
||||
RuleEvent += toString(static_cast<float>(b) / t * sRGBFactor, 4);
|
||||
break;
|
||||
default:
|
||||
RuleEvent = EMPTY_STRING;
|
||||
RuleEvent.clear();
|
||||
break;
|
||||
}
|
||||
if (!RuleEvent.isEmpty()) {
|
||||
@@ -466,7 +466,7 @@ boolean Plugin_050(uint8_t function, struct EventStruct *event, String& string)
|
||||
RuleEvent += c;
|
||||
break;
|
||||
default:
|
||||
RuleEvent = EMPTY_STRING;
|
||||
RuleEvent.clear();
|
||||
break;
|
||||
}
|
||||
if (!RuleEvent.isEmpty()) {
|
||||
|
||||
@@ -252,7 +252,7 @@ String rulesProcessingFile(const String& fileName, const String& event) {
|
||||
}
|
||||
|
||||
// Prepare for new line
|
||||
line = EMPTY_STRING;
|
||||
line.clear();
|
||||
line.reserve(longestLineSize);
|
||||
firstNonSpaceRead = false;
|
||||
commentFound = false;
|
||||
@@ -752,7 +752,7 @@ void parseCompleteNonCommentLine(String& line, const String& event,
|
||||
|
||||
String eventTrigger;
|
||||
|
||||
action = EMPTY_STRING;
|
||||
action.clear();
|
||||
|
||||
if (!codeBlock) // do not check "on" rules if a block of actions is to be
|
||||
// processed
|
||||
|
||||
@@ -334,7 +334,7 @@ void P104_data_struct::loadSettings() {
|
||||
zones.push_back(P104_zone_struct(zoneIndex + 1));
|
||||
|
||||
if (zones[zoneIndex].text == F("\"\"")) { // Special case
|
||||
zones[zoneIndex].text = EMPTY_STRING;
|
||||
zones[zoneIndex].text.clear();
|
||||
}
|
||||
|
||||
zoneIndex++;
|
||||
@@ -1566,7 +1566,7 @@ String P104_data_struct::enquoteString(const String& input) {
|
||||
* saveSettings gather the zones data from the UI and store in customsettings
|
||||
**************************************/
|
||||
bool P104_data_struct::saveSettings() {
|
||||
error = EMPTY_STRING; // Clear
|
||||
error.clear(); // Clear
|
||||
String zbuffer;
|
||||
|
||||
# ifdef P104_DEBUG_DEV
|
||||
@@ -1681,7 +1681,7 @@ bool P104_data_struct::saveSettings() {
|
||||
|
||||
if (zbuffer.reserve(P104_SETTINGS_BUFFER_V2 + 2)) {
|
||||
for (auto it = zones.begin(); it != zones.end() && error.length() == 0; ++it) {
|
||||
zbuffer = EMPTY_STRING;
|
||||
zbuffer.clear();
|
||||
|
||||
// WARNING: Order of values should match the numeric order of P104_OFFSET_* values
|
||||
zbuffer += it->size; // 2
|
||||
|
||||
Reference in New Issue
Block a user