Better algorithm validation.
This commit is contained in:
parent
a9cc5c5258
commit
230962230f
3 changed files with 29 additions and 2 deletions
|
@ -164,7 +164,18 @@ xmrig::CpuThread::cn_hash_fun xmrig::CpuThread::fn(Algo algorithm, AlgoVariant a
|
|||
}
|
||||
# endif
|
||||
|
||||
return func_table[40 * algorithm + 10 * variant + av - 1];
|
||||
const size_t index = 40 * algorithm + 10 * variant + av - 1;
|
||||
|
||||
# ifndef NDEBUG
|
||||
cn_hash_fun func = func_table[index];
|
||||
|
||||
assert(index < sizeof(func_table) / sizeof(func_table[0]));
|
||||
assert(func != nullptr);
|
||||
|
||||
return func;
|
||||
# else
|
||||
return func_table[index];
|
||||
# endif
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue