diff --git a/common/SigUtil.cpp b/common/SigUtil.cpp index 697f8d3724..09201ea4fa 100644 --- a/common/SigUtil.cpp +++ b/common/SigUtil.cpp @@ -64,7 +64,7 @@ static std::atomic ForwardSigUsr2Flag(false); //< Flags to forward SIG_USR #endif static size_t ActivityStringIndex = 0; -static std::string ActivityHeader = ""; +static std::string ActivityHeader; static std::array ActivityStrings; static bool UnattendedRun = false; #if !MOBILEAPP diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp index b68f699170..5ea185cddc 100644 --- a/kit/ChildSession.cpp +++ b/kit/ChildSession.cpp @@ -2725,7 +2725,7 @@ bool ChildSession::updateBlockingCommandStatus(const StringVector& tokens) sendTextFrameAndLogError("error: cmd=lockstatus kind=failure"); return false; } - std::string blockedCommands = ""; + std::string blockedCommands; if (restrictedStatus == "true") blockedCommands += CommandControl::RestrictionManager::getRestrictedCommandListString(); if (lockStatus == "true") diff --git a/tools/Replay.hpp b/tools/Replay.hpp index b8996a689a..dad812d076 100644 --- a/tools/Replay.hpp +++ b/tools/Replay.hpp @@ -328,7 +328,7 @@ public: std::string out = msg; if (tokens.equals(0, "tileprocessed")) - out = ""; // we do this accurately below + out.clear(); // we do this accurately below else if (tokens.equals(0, "load")) { std::string url = tokens[1]; diff --git a/tools/map.cpp b/tools/map.cpp index 3ef5265a33..c96e1267e5 100644 --- a/tools/map.cpp +++ b/tools/map.cpp @@ -370,7 +370,7 @@ static void dumpDiff(const AddrSpace &space, (str != "[anon]") && (str != "[stack]"); if (!haveAnnots) - str = ""; + str.clear(); else map->bumpPointerCountInUnshared(); } diff --git a/wsd/Admin.cpp b/wsd/Admin.cpp index bfe2adbaf2..fcdd489395 100644 --- a/wsd/Admin.cpp +++ b/wsd/Admin.cpp @@ -844,7 +844,7 @@ std::string Admin::getLogLines() lineCount = (int)lines.size(); } - line = ""; // Use the same variable to include result. + line.clear(); // Use the same variable to include result. // Newest will be on top. for (int i = lineCount - 1; i >= 0; i--) { diff --git a/wsd/AdminModel.cpp b/wsd/AdminModel.cpp index e1df67f942..199953704f 100644 --- a/wsd/AdminModel.cpp +++ b/wsd/AdminModel.cpp @@ -219,7 +219,7 @@ std::string AdminModel::getAllHistory() const separator1 = ","; } oss << "], \"expiredDocuments\" : ["; - separator1 = ""; + separator1.clear(); for (const auto& ed : _expiredDocuments) { oss << separator1; diff --git a/wsd/COOLWSD.cpp b/wsd/COOLWSD.cpp index bd02b235fb..a875e2880c 100644 --- a/wsd/COOLWSD.cpp +++ b/wsd/COOLWSD.cpp @@ -1923,7 +1923,7 @@ private: fonts.clear(); // Clear the saved ETag of the remote font configuration file so that it will be // re-downloaded, and all fonts mentioned in it re-downloaded and fed to ForKit. - _eTagValue = ""; + _eTagValue.clear(); COOLWSD::sendMessageToForKit("exit"); } @@ -2743,7 +2743,7 @@ void COOLWSD::innerInitialize(Application& self) LOG_INF("Your support key is valid for " << validDays << " days"); COOLWSD::MaxConnections = 1000; COOLWSD::MaxDocuments = 200; - COOLWSD::OverrideWatermark = ""; + COOLWSD::OverrideWatermark.clear(); } } } diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp index 752ca872da..520a992a06 100644 --- a/wsd/ClientSession.cpp +++ b/wsd/ClientSession.cpp @@ -592,7 +592,7 @@ bool ClientSession::_handleInput(const char *buffer, int length) } else if (tokens.equals(0, "load")) { - if (getDocURL() != "") + if (!getDocURL().empty()) { sendTextFrameAndLogError("error: cmd=load kind=docalreadyloaded"); return false; @@ -1189,14 +1189,14 @@ bool ClientSession::loadDocument(const char* /*buffer*/, int /*length*/, std::string encodedUserId; Poco::URI::encode(getUserId(), "", encodedUserId); oss << " authorid=" << encodedUserId; - encodedUserId = ""; + encodedUserId.clear(); Poco::URI::encode(COOLWSD::anonymizeUsername(getUserId()), "", encodedUserId); oss << " xauthorid=" << encodedUserId; std::string encodedUserName; Poco::URI::encode(getUserName(), "", encodedUserName); oss << " author=" << encodedUserName; - encodedUserName = ""; + encodedUserName.clear(); Poco::URI::encode(COOLWSD::anonymizeUsername(getUserName()), "", encodedUserName); oss << " xauthor=" << encodedUserName; } diff --git a/wsd/FileServerUtil.cpp b/wsd/FileServerUtil.cpp index 487cbe7d19..2b5fe9abf6 100644 --- a/wsd/FileServerUtil.cpp +++ b/wsd/FileServerUtil.cpp @@ -202,7 +202,7 @@ std::string FileServerRequestHandler::uiDefaultsToJSON(const std::string& uiDefa Poco::JSON::Object presentationDefs; Poco::JSON::Object drawingDefs; - uiMode = ""; + uiMode.clear(); uiTheme = "light"; savedUIState = "true"; StringVector tokens(StringVector::tokenize(uiDefaults, ';'));