Core/UI: use clear() and empty() for std containers

This commit is contained in:
Herman Semenoff
2026-05-17 21:28:31 +03:00
parent dbb34075bc
commit d406f63102
5 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -397,7 +397,7 @@ void PopupMultiChoice::UpdateText() {
}
valueText_ = std::move(text);
} else {
valueText_ = "";
valueText_.clear();
}
}
}
+1 -1
View File
@@ -1596,7 +1596,7 @@ void Config::PostLoadCleanup() {
// Remove a legacy value.
if (g_Config.sCustomDriver == "Default") {
g_Config.sCustomDriver = "";
g_Config.sCustomDriver.clear();
}
// Squash unsupported screen rotations.
+1 -1
View File
@@ -322,7 +322,7 @@ bool ConfigSetting::RestoreToDefault(ConfigBlock *configBlock, bool log) const {
} else if (default_.s != nullptr) {
*ptr_s = default_.s;
} else {
*ptr_s = "";
ptr_s->clear();
}
if (*ptr_s != origValue) {
if (log) {
+1 -1
View File
@@ -225,7 +225,7 @@ IdentifiedFileType Identify_File(FileLoader *fileLoader, std::string *errorStrin
Path filename = fileLoader->GetPath();
// There are a few elfs misnamed as pbp (like Trig Wars), accept that. Also accept extension-less paths.
if (extension == ".plf" || strstr(filename.GetFilename().c_str(), "BOOT.BIN") ||
extension == ".elf" || extension == ".prx" || extension == ".pbp" || extension == "") {
extension == ".elf" || extension == ".prx" || extension == ".pbp" || extension.empty()) {
return IdentifiedFileType::PSP_ELF;
}
return IdentifiedFileType::UNKNOWN_ELF;
+2 -2
View File
@@ -194,7 +194,7 @@ void ImStructViewer::WatchForm::Clear() {
memset(name, 0, sizeof(name));
memset(expression, 0, sizeof(expression));
dynamic = false;
error = "";
error.clear();
typeFilter.Clear();
// Not clearing the actual selected type on purpose here, user will have to reselect one anyway and
// maybe there is a chance they will reuse the current one
@@ -213,7 +213,7 @@ void ImStructViewer::WatchForm::SetFrom(const std::unordered_map<std::string, Gh
snprintf(expression, sizeof(expression), "%s", watch.expression.c_str());
}
dynamic = !watch.expression.empty();
error = "";
error.clear();
}
static constexpr int COLUMN_NAME = 0;