From eb56c2b56eb799097629dfd2f360a9138865db8d Mon Sep 17 00:00:00 2001 From: XMRig Date: Sun, 8 Apr 2018 03:20:44 +0700 Subject: [PATCH] Better implementation for algorithm aliases. --- src/core/CommonConfig.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/core/CommonConfig.cpp b/src/core/CommonConfig.cpp index 8950775c..a36b6553 100644 --- a/src/core/CommonConfig.cpp +++ b/src/core/CommonConfig.cpp @@ -388,16 +388,9 @@ void xmrig::CommonConfig::setAlgo(const char *algo) assert(size == (sizeof(algoNamesShort) / sizeof(algoNamesShort[0]))); for (size_t i = 0; i < size; i++) { - if (algoNames[i] && strcasecmp(algo, algoNames[i]) == 0) { + if (strcasecmp(algo, algoNames[i]) == 0 || strcasecmp(algo, algoNamesShort[i]) == 0) { m_algorithm = static_cast(i); - return; - } - } - - for (size_t i = 0; i < size; i++) { - if (algoNamesShort[i] && strcasecmp(algo, algoNamesShort[i]) == 0) { - m_algorithm = static_cast(i); - return; + break; } } }