From 5f87dae972544f8a2700f0769607c64fb9d8dad0 Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Thu, 6 Dec 2018 01:51:27 -0500 Subject: [PATCH] no need to avoid copy --- include/types.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/types.h b/include/types.h index 166548c..828d4d8 100644 --- a/include/types.h +++ b/include/types.h @@ -75,8 +75,8 @@ struct ThreadParam uint64_t ctx2; // The subcontext of the hook: 0 by default, generated in a method specific to the hook }; // Artikash 5/31/2018: required for unordered_map to work with struct key -template <> struct std::hash { size_t operator()(const ThreadParam& tp) const { return std::hash()((tp.processId + tp.addr) ^ (tp.ctx + tp.ctx2)); } }; -static bool operator==(const ThreadParam& one, const ThreadParam& two) { return one.processId == two.processId && one.addr == two.addr && one.ctx == two.ctx && one.ctx2 == two.ctx2; } +template <> struct std::hash { size_t operator()(ThreadParam tp) const { return std::hash()((tp.processId + tp.addr) ^ (tp.ctx + tp.ctx2)); } }; +static bool operator==(ThreadParam one, ThreadParam two) { return one.processId == two.processId && one.addr == two.addr && one.ctx == two.ctx && one.ctx2 == two.ctx2; } class WinMutex // Like CMutex but works with lock_guard {