mirror of
https://github.com/rdkit/rdkit.git
synced 2026-06-03 21:44:30 +08:00
Dev/pvs studio cleanups2 (#2877)
* a round of cleanups courtesy of PVS studio * add a test to make sure that a warning is a false alarm * bug fix * Fix a UFF bug * more PVS studio cleanups * next round of PVS studio cleanups * completely remove the chances for that bug * changes in response to review * add an additional test + a bit of reformatting that snuck in
This commit is contained in:
@@ -116,9 +116,10 @@ class LeaderPicker : public DistPicker {
|
||||
};
|
||||
|
||||
#ifdef USE_THREADED_LEADERPICKER
|
||||
// Note that this block of code currently only works on linux (which is why it's disabled by default)
|
||||
// We will revisit this during the 2020.03 release cycle in order to get a multi-threaded version of
|
||||
// the LeaderPicker that works on all supported platforms
|
||||
// Note that this block of code currently only works on linux (which is why it's
|
||||
// disabled by default) We will revisit this during the 2020.03 release cycle in
|
||||
// order to get a multi-threaded version of the LeaderPicker that works on all
|
||||
// supported platforms
|
||||
template <typename T>
|
||||
void *LeaderPickerWork(void *arg);
|
||||
|
||||
@@ -325,10 +326,9 @@ struct LeaderPickerState {
|
||||
int query;
|
||||
T *func;
|
||||
|
||||
LeaderPickerState(unsigned int count, int) {
|
||||
LeaderPickerState(unsigned int count, int) : left(count), threshold(0.0), query(0), func(nullptr) {
|
||||
v.resize(count);
|
||||
for (unsigned int i = 0; i < count; i++) v[i] = i;
|
||||
left = count;
|
||||
}
|
||||
|
||||
bool empty() { return left == 0; }
|
||||
|
||||
@@ -151,10 +151,6 @@ RDKit::INT_VECT MaxMinPicker::lazyPick(T &func, unsigned int poolSize,
|
||||
|
||||
unsigned int memsize = (unsigned int)(poolSize * sizeof(MaxMinPickInfo));
|
||||
MaxMinPickInfo *pinfo = new MaxMinPickInfo[memsize];
|
||||
if (!pinfo) {
|
||||
threshold = -1.0;
|
||||
return picks;
|
||||
}
|
||||
memset(pinfo, 0, memsize);
|
||||
|
||||
picks.reserve(pickSize);
|
||||
|
||||
Reference in New Issue
Block a user