syncqt: use empty() to check for empty std::string

Change-Id: I5ce11d0440d76aee4b12b9638eff6fa0071bc2b7
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
This commit is contained in:
Maxime Roussin-Bélanger 2022-11-03 22:14:25 -04:00
parent d193fcdf0d
commit 65c1b12f9f

View File

@ -300,7 +300,7 @@ private:
std::set<std::string> *currentListValue = nullptr; std::set<std::string> *currentListValue = nullptr;
for (int i = 1; i < argc; ++i) { for (int i = 1; i < argc; ++i) {
std::string arg(argv[i]); std::string arg(argv[i]);
if (arg.size() == 0) if (arg.empty())
continue; continue;
if (arg.size() > 0 && arg[0] == '-') { if (arg.size() > 0 && arg[0] == '-') {
@ -380,7 +380,7 @@ private:
} }
for (const auto &header : generatedHeaders) { for (const auto &header : generatedHeaders) {
if (header.size() == 0) if (header.empty())
continue; continue;
if (header[0] == '@') { if (header[0] == '@') {
std::ifstream ifs(header.substr(1), std::ifstream::in); std::ifstream ifs(header.substr(1), std::ifstream::in);
@ -563,7 +563,7 @@ public:
const auto &headers = m_commandLineArgs->headers(); const auto &headers = m_commandLineArgs->headers();
for (auto it = headers.begin(); it != headers.end(); ++it) { for (auto it = headers.begin(); it != headers.end(); ++it) {
const auto &header = *it; const auto &header = *it;
if (header.size() > 0 && header[0] == '@') { if (!header.empty() && header[0] == '@') {
std::ifstream ifs(header.substr(1), std::ifstream::in); std::ifstream ifs(header.substr(1), std::ifstream::in);
if (ifs.is_open()) { if (ifs.is_open()) {
std::string headerFromFile; std::string headerFromFile;
@ -823,7 +823,7 @@ public:
// Record the private header file inside the version script content. // Record the private header file inside the version script content.
if (isPrivate && !m_commandLineArgs->versionScriptFile().empty() if (isPrivate && !m_commandLineArgs->versionScriptFile().empty()
&& parsingResult.versionScriptContent.size() > 0) { && !parsingResult.versionScriptContent.empty()) {
m_versionScriptContents.insert(m_versionScriptContents.end(), m_versionScriptContents.insert(m_versionScriptContents.end(),
parsingResult.versionScriptContent.begin(), parsingResult.versionScriptContent.begin(),
parsingResult.versionScriptContent.end()); parsingResult.versionScriptContent.end());
@ -882,7 +882,7 @@ public:
symbol = match[1].str(); symbol = match[1].str();
// checkLineForSymbols(buffer, symbol); // checkLineForSymbols(buffer, symbol);
if (symbol.size() > 0 && symbol[symbol.size() - 1] != ';') { if (!symbol.empty() && symbol[symbol.size() - 1] != ';') {
std::string relPath = m_currentFileInSourceDir std::string relPath = m_currentFileInSourceDir
? std::filesystem::relative(m_currentFile, m_commandLineArgs->sourceDir()) ? std::filesystem::relative(m_currentFile, m_commandLineArgs->sourceDir())
.string() .string()
@ -1091,7 +1091,7 @@ public:
} }
line.clear(); line.clear();
if (buffer.size() == 0) if (buffer.empty())
continue; continue;
scannerDebug() << m_currentFilename << ": " << buffer << std::endl; scannerDebug() << m_currentFilename << ": " << buffer << std::endl;