Use left shift instead of floating-point pow() in equihash.

This commit is contained in:
Taylor Hornby 2016-05-17 13:44:20 -06:00
parent 6fe2e85816
commit 675e17022f
1 changed files with 1 additions and 2 deletions

View File

@ -16,7 +16,6 @@
#include "util.h"
#include <algorithm>
#include <cmath>
#include <iostream>
#include <stdexcept>
@ -247,7 +246,7 @@ std::set<std::vector<eh_index>> Equihash::BasicSolve(const eh_HashState& base_st
bool Equihash::IsValidSolution(const eh_HashState& base_state, std::vector<eh_index> soln)
{
eh_index soln_size { pow(2, k) };
eh_index soln_size { 1u << k };
if (soln.size() != soln_size) {
LogPrint("pow", "Invalid solution size: %d\n", soln.size());
return false;