From ead47b2aa2083548d1b96bc20e9fd8301541df3a Mon Sep 17 00:00:00 2001 From: stefansjfw <57057282+stefansjfw@users.noreply.github.com> Date: Fri, 27 Mar 2020 23:12:41 +0100 Subject: [PATCH] Remove unneded assignments (#1755) * Remove uneeded assignments * Use const iterators --- src/modules/fancyzones/lib/JsonHelpers.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/fancyzones/lib/JsonHelpers.cpp b/src/modules/fancyzones/lib/JsonHelpers.cpp index 6aeb50c297..c6194365e1 100644 --- a/src/modules/fancyzones/lib/JsonHelpers.cpp +++ b/src/modules/fancyzones/lib/JsonHelpers.cpp @@ -685,13 +685,13 @@ namespace JSONHelpers // int version = data[0] * 256 + data[1]; - Not used anymore std::wstring uuid = std::to_wstring(data[3] * 256 + data[4]); - auto it = std::find_if(appliedZoneSetsMap.begin(), appliedZoneSetsMap.end(), [&uuid](std::pair zoneSetMap) { + auto it = std::find_if(appliedZoneSetsMap.cbegin(), appliedZoneSetsMap.cend(), [&uuid](std::pair zoneSetMap) { return zoneSetMap.second.uuid.compare(uuid) == 0; }); - if (it != appliedZoneSetsMap.end()) + if (it != appliedZoneSetsMap.cend()) { - it->second.uuid = uuid = it->first; + uuid = it->first; } else { @@ -704,7 +704,7 @@ namespace JSONHelpers wil::unique_cotaskmem_string guidString; if (SUCCEEDED_LOG(StringFromCLSID(guid, &guidString))) { - it->second.uuid = uuid = guidString.get(); + uuid = guidString.get(); } }