mirror of
https://github.com/xmrig/xmrig.git
synced 2025-12-08 08:23:34 -05:00
Better implementation for algorithm aliases.
This commit is contained in:
@@ -388,16 +388,9 @@ void xmrig::CommonConfig::setAlgo(const char *algo)
|
|||||||
assert(size == (sizeof(algoNamesShort) / sizeof(algoNamesShort[0])));
|
assert(size == (sizeof(algoNamesShort) / sizeof(algoNamesShort[0])));
|
||||||
|
|
||||||
for (size_t i = 0; i < size; i++) {
|
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<Algo>(i);
|
m_algorithm = static_cast<Algo>(i);
|
||||||
return;
|
break;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (size_t i = 0; i < size; i++) {
|
|
||||||
if (algoNamesShort[i] && strcasecmp(algo, algoNamesShort[i]) == 0) {
|
|
||||||
m_algorithm = static_cast<xmrig::Algo>(i);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user