From 4f6ffb67c19839b5c60a043e969c17955e015f52 Mon Sep 17 00:00:00 2001 From: XMRig Date: Sat, 14 Aug 2021 04:58:01 +0700 Subject: [PATCH] Cleanup. --- src/crypto/cn/CnHash.cpp | 3 +-- src/crypto/cn/CnHash.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/crypto/cn/CnHash.cpp b/src/crypto/cn/CnHash.cpp index a1bec4967..0961f6f6c 100644 --- a/src/crypto/cn/CnHash.cpp +++ b/src/crypto/cn/CnHash.cpp @@ -41,7 +41,7 @@ #define ADD_FN(algo) do { \ - if (!m_map[algo]) m_map[algo] = new cn_hash_fun_array{}; \ + m_map[algo] = new cn_hash_fun_array{}; \ m_map[algo]->data[AV_SINGLE][Assembly::NONE] = cryptonight_single_hash; \ m_map[algo]->data[AV_SINGLE_SOFT][Assembly::NONE] = cryptonight_single_hash; \ m_map[algo]->data[AV_DOUBLE][Assembly::NONE] = cryptonight_double_hash; \ @@ -57,7 +57,6 @@ #ifdef XMRIG_FEATURE_ASM # define ADD_FN_ASM(algo) do { \ - if (!m_map[algo]) m_map[algo] = new cn_hash_fun_array{}; \ m_map[algo]->data[AV_SINGLE][Assembly::INTEL] = cryptonight_single_hash_asm; \ m_map[algo]->data[AV_SINGLE][Assembly::RYZEN] = cryptonight_single_hash_asm; \ m_map[algo]->data[AV_SINGLE][Assembly::BULLDOZER] = cryptonight_single_hash_asm; \ diff --git a/src/crypto/cn/CnHash.h b/src/crypto/cn/CnHash.h index 727ef9d50..5aac95443 100644 --- a/src/crypto/cn/CnHash.h +++ b/src/crypto/cn/CnHash.h @@ -62,11 +62,11 @@ public: static cn_hash_fun fn(const Algorithm &algorithm, AlgoVariant av, Assembly::Id assembly); +private: struct cn_hash_fun_array { cn_hash_fun data[AV_MAX][Assembly::MAX]; }; -private: std::map m_map; };