Miner: filter invalid algos

This commit is contained in:
cohcho 2020-09-25 17:25:23 +00:00
parent 7b38af703e
commit 189cc78d44
2 changed files with 2 additions and 2 deletions

View file

@ -96,7 +96,7 @@ public:
inline bool isCN() const { auto f = family(); return f == CN || f == CN_LITE || f == CN_HEAVY || f == CN_PICO; }
inline bool isEqual(const Algorithm &other) const { return m_id == other.m_id; }
inline bool isValid() const { return m_id != INVALID; }
inline bool isValid() const { return m_id != INVALID && family() != UNKNOWN; }
inline const char *name() const { return name(false); }
inline const char *shortName() const { return name(true); }
inline Family family() const { return family(m_id); }

View file

@ -121,7 +121,7 @@ public:
for (int i = 0; i < Algorithm::MAX; ++i) {
const Algorithm algo(static_cast<Algorithm::Id>(i));
if (isEnabled(algo)) {
if (algo.isValid() && isEnabled(algo)) {
algorithms.push_back(algo);
}
}