From 45758add5d8aaf7122087844bbe1abe6324b90ec Mon Sep 17 00:00:00 2001 From: Dan McCarthy Date: Tue, 28 Nov 2023 16:17:08 -0600 Subject: [PATCH] Use consistent snake_case naming & don't pass string_view by ref Addresses feedback to use consistent naming conventions as most variables are using snake_case. Also no longer passes string_view by reference as per feedback. --- pcsx2-qt/Settings/GamePatchSettingsWidget.cpp | 6 +++--- pcsx2/Patch.cpp | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pcsx2-qt/Settings/GamePatchSettingsWidget.cpp b/pcsx2-qt/Settings/GamePatchSettingsWidget.cpp index ae1650c384..7b0b35013c 100644 --- a/pcsx2-qt/Settings/GamePatchSettingsWidget.cpp +++ b/pcsx2-qt/Settings/GamePatchSettingsWidget.cpp @@ -88,12 +88,12 @@ void GamePatchSettingsWidget::onReloadClicked() void GamePatchSettingsWidget::reloadList() { // Patches shouldn't have any unlabelled patch groups, because they're new. - u32 numberOfUnlabeledPatches = 0; - std::vector patches = Patch::GetPatchInfo(m_dialog->getSerial(), m_dialog->getDiscCRC(), false, &numberOfUnlabeledPatches); + u32 number_of_unlabeled_patches = 0; + std::vector patches = Patch::GetPatchInfo(m_dialog->getSerial(), m_dialog->getDiscCRC(), false, &number_of_unlabeled_patches); std::vector enabled_list = m_dialog->getSettingsInterface()->GetStringList(Patch::PATCHES_CONFIG_SECTION, Patch::PATCH_ENABLE_CONFIG_KEY); - setUnlabeledPatchesWarningVisibility(numberOfUnlabeledPatches > 0); + setUnlabeledPatchesWarningVisibility(number_of_unlabeled_patches > 0); delete m_ui.scrollArea->takeWidget(); QWidget* container = new QWidget(m_ui.scrollArea); diff --git a/pcsx2/Patch.cpp b/pcsx2/Patch.cpp index c01c99c3ef..1a1f7cc9f7 100644 --- a/pcsx2/Patch.cpp +++ b/pcsx2/Patch.cpp @@ -158,8 +158,8 @@ namespace Patch static std::vector FindPatchFilesOnDisk( const std::string_view& serial, u32 crc, bool cheats, bool all_crcs); - static bool ContainsPatchName(const PatchInfoList& patches, const std::string_view& patchName); - static bool ContainsPatchName(const PatchList& patches, const std::string_view& patchName); + static bool ContainsPatchName(const PatchInfoList& patches, const std::string_view patchName); + static bool ContainsPatchName(const PatchList& patches, const std::string_view patchName); template static void EnumeratePnachFiles(const std::string_view& serial, u32 crc, bool cheats, bool for_ui, const F& f); @@ -219,11 +219,11 @@ void Patch::TrimPatchLine(std::string& buffer) buffer.erase(pos); } -bool Patch::ContainsPatchName(const PatchList& patchList, const std::string_view& patchName) +bool Patch::ContainsPatchName(const PatchList& patch_list, const std::string_view patch_name) { - return std::find_if(patchList.begin(), patchList.end(), [&patchName](const PatchGroup& patch) { - return patch.name == patchName; - }) != patchList.end(); + return std::find_if(patch_list.begin(), patch_list.end(), [&patch_name](const PatchGroup& patch) { + return patch.name == patch_name; + }) != patch_list.end(); } int Patch::PatchTableExecute(PatchGroup* group, const std::string_view& lhs, const std::string_view& rhs, @@ -369,7 +369,7 @@ std::vector Patch::FindPatchFilesOnDisk(const std::string_view& ser return ret; } -bool Patch::ContainsPatchName(const PatchInfoList& patches, const std::string_view& patchName) +bool Patch::ContainsPatchName(const PatchInfoList& patches, const std::string_view patchName) { return std::find_if(patches.begin(), patches.end(), [&patchName](const PatchInfo& patch) { return patch.name == patchName;