Removed m_bench field from Job class.

This commit is contained in:
XMRig 2020-10-16 20:29:11 +07:00
parent 36b1523194
commit 7fc7b976bf
No known key found for this signature in database
GPG key ID: 446A53638BE94409
19 changed files with 44 additions and 68 deletions

View file

@ -174,10 +174,6 @@ void xmrig::Job::copy(const Job &other)
memcpy(m_rawBlob, other.m_rawBlob, sizeof(m_rawBlob));
memcpy(m_rawTarget, other.m_rawTarget, sizeof(m_rawTarget));
# endif
# ifdef XMRIG_FEATURE_BENCHMARK
m_bench = other.m_bench;
# endif
}
@ -209,8 +205,4 @@ void xmrig::Job::move(Job &&other)
memcpy(m_rawBlob, other.m_rawBlob, sizeof(m_rawBlob));
memcpy(m_rawTarget, other.m_rawTarget, sizeof(m_rawTarget));
# endif
# ifdef XMRIG_FEATURE_BENCHMARK
m_bench = other.m_bench;
# endif
}

View file

@ -111,11 +111,6 @@ public:
inline Job &operator=(const Job &other) { copy(other); return *this; }
inline Job &operator=(Job &&other) noexcept { move(std::move(other)); return *this; }
# ifdef XMRIG_FEATURE_BENCHMARK
inline uint32_t bench() const { return m_bench; }
inline void setBench(uint32_t bench) { m_bench = bench; }
# endif
private:
void copy(const Job &other);
void move(Job &&other);
@ -140,10 +135,6 @@ private:
char m_rawTarget[24]{};
String m_rawSeedHash;
# endif
# ifdef XMRIG_FEATURE_BENCHMARK
uint32_t m_bench = 0;
# endif
};

View file

@ -59,5 +59,4 @@ void xmrig::NullClient::setPool(const Pool& pool)
}
m_job.setAlgorithm(m_pool.algorithm().id());
m_job.setBench(m_pool.benchSize());
}

View file

@ -113,7 +113,7 @@ public:
inline void setUser(const String &user) { m_user = user; }
# ifdef XMRIG_FEATURE_BENCHMARK
inline uint64_t benchSize() const { return m_benchSize; }
inline uint32_t benchSize() const { return m_benchSize; }
# endif
inline bool operator!=(const Pool &other) const { return !isEqual(other); }

View file

@ -65,18 +65,6 @@ bool xmrig::Pools::isEqual(const Pools &other) const
}
int xmrig::Pools::donateLevel() const
{
# ifdef XMRIG_FEATURE_BENCHMARK
if (m_data.size() == 1 && m_data.front().mode() == Pool::MODE_BENCHMARK) {
return 0;
}
# endif
return m_donateLevel;
}
xmrig::IStrategy *xmrig::Pools::createStrategy(IStrategyListener *listener) const
{
if (active() == 1) {
@ -153,6 +141,18 @@ void xmrig::Pools::load(const IJsonReader &reader)
}
uint32_t xmrig::Pools::benchSize() const
{
# ifdef XMRIG_FEATURE_BENCHMARK
if (m_data.size() == 1 && m_data.front().mode() == Pool::MODE_BENCHMARK) {
return m_data.front().benchSize();
}
# endif
return 0;
}
void xmrig::Pools::print() const
{
size_t i = 1;

View file

@ -58,6 +58,7 @@ public:
Pools();
inline const std::vector<Pool> &data() const { return m_data; }
inline int donateLevel() const { return benchSize() ? 0 : m_donateLevel; }
inline int retries() const { return m_retries; }
inline int retryPause() const { return m_retryPause; }
inline ProxyDonate proxyDonate() const { return m_proxyDonate; }
@ -66,10 +67,10 @@ public:
inline bool operator==(const Pools &other) const { return isEqual(other); }
bool isEqual(const Pools &other) const;
int donateLevel() const;
IStrategy *createStrategy(IStrategyListener *listener) const;
rapidjson::Value toJSON(rapidjson::Document &doc) const;
size_t active() const;
uint32_t benchSize() const;
void load(const IJsonReader &reader);
void print() const;