1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

backport: checks and fixes from static code analyzers results

original commit: 71f665bd8c
This commit is contained in:
Alexander Alekhin
2020-09-01 22:18:20 +00:00
parent f9fbd29c14
commit 1f2c83845d
8 changed files with 42 additions and 22 deletions
@@ -160,7 +160,8 @@ class KNNResultSet : public ResultSet<DistanceType>
DistanceType worst_distance_;
public:
KNNResultSet(int capacity_) : capacity(capacity_), count(0)
KNNResultSet(int capacity_)
: indices(NULL), dists(NULL), capacity(capacity_), count(0), worst_distance_(0)
{
}
@@ -186,6 +187,8 @@ public:
void addPoint(DistanceType dist, int index) CV_OVERRIDE
{
CV_DbgAssert(indices);
CV_DbgAssert(dists);
if (dist >= worst_distance_) return;
int i;
for (i = count; i > 0; --i) {
@@ -60,6 +60,7 @@ public:
* Constructor.
*/
StartStopTimer()
: startTime(0)
{
reset();
}