3
3
*
4
4
* Copyright 2008-2009 Marius Muja ([email protected] ). All rights reserved.
5
5
* Copyright 2008-2009 David G. Lowe ([email protected] ). All rights reserved.
6
- * Copyright 2011-2023 Jose Luis Blanco ([email protected] ).
6
+ * Copyright 2011-2024 Jose Luis Blanco ([email protected] ).
7
7
* All rights reserved.
8
8
*
9
9
* THE BSD LICENSE
49
49
#include < atomic>
50
50
#include < cassert>
51
51
#include < cmath> // for abs()
52
- #include < cstdlib> // for abs()
53
52
#include < cstdint>
53
+ #include < cstdlib> // for abs()
54
54
#include < functional> // std::reference_wrapper
55
55
#include < future>
56
56
#include < istream>
@@ -273,8 +273,7 @@ class RKNNResultSet
273
273
indices = indices_;
274
274
dists = dists_;
275
275
count = 0 ;
276
- if (capacity)
277
- dists[capacity - 1 ] = maximumSearchDistanceSquared;
276
+ if (capacity) dists[capacity - 1 ] = maximumSearchDistanceSquared;
278
277
}
279
278
280
279
CountType size () const { return count; }
@@ -832,7 +831,7 @@ struct SearchParameters
832
831
*/
833
832
class PooledAllocator
834
833
{
835
- static constexpr size_t WORDSIZE = 16 ; // WORDSIZE must >= 8
834
+ static constexpr size_t WORDSIZE = 16 ; // WORDSIZE must >= 8
836
835
static constexpr size_t BLOCKSIZE = 8192 ;
837
836
838
837
/* We maintain memory alignment to word boundaries by requiring that all
@@ -903,9 +902,7 @@ class PooledAllocator
903
902
904
903
/* Allocate new storage. */
905
904
const Size blocksize =
906
- size > BLOCKSIZE
907
- ? size + WORDSIZE
908
- : BLOCKSIZE + WORDSIZE;
905
+ size > BLOCKSIZE ? size + WORDSIZE : BLOCKSIZE + WORDSIZE;
909
906
910
907
// use the standard C malloc to allocate memory
911
908
void * m = ::malloc (blocksize);
@@ -920,7 +917,7 @@ class PooledAllocator
920
917
base_ = m;
921
918
922
919
remaining_ = blocksize - WORDSIZE;
923
- loc_ = static_cast <char *>(m) + WORDSIZE;
920
+ loc_ = static_cast <char *>(m) + WORDSIZE;
924
921
}
925
922
void * rloc = loc_;
926
923
loc_ = static_cast <char *>(loc_) + size;
@@ -1302,7 +1299,7 @@ class KDTreeBaseClass
1302
1299
}
1303
1300
ElementType max_spread = -1 ;
1304
1301
cutfeat = 0 ;
1305
- ElementType min_elem = 0 , max_elem = 0 ;
1302
+ ElementType min_elem = 0 , max_elem = 0 ;
1306
1303
for (Dimension i = 0 ; i < dims; ++i)
1307
1304
{
1308
1305
ElementType span = bbox[i].high - bbox[i].low ;
@@ -1315,8 +1312,8 @@ class KDTreeBaseClass
1315
1312
{
1316
1313
cutfeat = i;
1317
1314
max_spread = spread;
1318
- min_elem = min_elem_;
1319
- max_elem = max_elem_;
1315
+ min_elem = min_elem_;
1316
+ max_elem = max_elem_;
1320
1317
}
1321
1318
}
1322
1319
}
0 commit comments