From 5513057f537bbb7a907bad522871c1a0e64fe9bd Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Fri, 2 Dec 2022 00:28:29 +0100 Subject: [PATCH] Pass patterns by const string reference --- r5dev/public/utility/sigcache.cpp | 4 ++-- r5dev/public/utility/sigcache.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/r5dev/public/utility/sigcache.cpp b/r5dev/public/utility/sigcache.cpp index 26679966..db7a9023 100644 --- a/r5dev/public/utility/sigcache.cpp +++ b/r5dev/public/utility/sigcache.cpp @@ -7,11 +7,11 @@ #include "public/utility/binstream.h" #include "sigcache.h" -void CSigCache::AddEntry(const char* pszPattern, const size_t nMaskLen, const uint64_t nRVA) +void CSigCache::AddEntry(const string& svPattern, const uint64_t nRVA) { if (g_SigCache.m_bUseCache) { - (*g_SigCache.m_Cache.mutable_smap())[string(pszPattern, nMaskLen)] = nRVA; + (*g_SigCache.m_Cache.mutable_smap())[svPattern] = nRVA; } } diff --git a/r5dev/public/utility/sigcache.h b/r5dev/public/utility/sigcache.h index 2849a9f8..2f3b7c7c 100644 --- a/r5dev/public/utility/sigcache.h +++ b/r5dev/public/utility/sigcache.h @@ -14,7 +14,7 @@ public: // Load // Clear - void AddEntry(const char* pszPattern, const size_t nMaskLen, const uint64_t nRVA); + void AddEntry(const string& svPattern, const uint64_t nRVA); void WriteCache(); SigMap_Pb m_Cache;