summaryrefslogtreecommitdiffstats
path: root/vespalib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-05-17 19:23:45 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2023-05-17 21:42:50 +0000
commit94b8a3225dd2338b8e81c1fb8230f903bb50b1da (patch)
tree215bec3162d2a4e05215bab85f28fc57007ea341 /vespalib
parent7832c68dc4cb00bea2a048d82d7f242625bb66a1 (diff)
GC unused assert includes
Diffstat (limited to 'vespalib')
-rw-r--r--vespalib/src/vespa/vespalib/btree/btreenodeallocator.h6
-rw-r--r--vespalib/src/vespa/vespalib/geo/zcurve.cpp28
-rw-r--r--vespalib/src/vespa/vespalib/geo/zcurve.h31
-rw-r--r--vespalib/src/vespa/vespalib/metrics/simple_metrics_manager.cpp1
-rw-r--r--vespalib/src/vespa/vespalib/metrics/stable_store.h5
-rw-r--r--vespalib/src/vespa/vespalib/util/fiddle.h6
-rw-r--r--vespalib/src/vespa/vespalib/util/latch.h1
7 files changed, 34 insertions, 44 deletions
diff --git a/vespalib/src/vespa/vespalib/btree/btreenodeallocator.h b/vespalib/src/vespa/vespalib/btree/btreenodeallocator.h
index b537602c703..c7c635b4471 100644
--- a/vespalib/src/vespa/vespalib/btree/btreenodeallocator.h
+++ b/vespalib/src/vespa/vespalib/btree/btreenodeallocator.h
@@ -34,10 +34,6 @@ public:
using DataStoreBase = datastore::DataStoreBase;
private:
- BTreeNodeAllocator(const BTreeNodeAllocator &rhs);
-
- BTreeNodeAllocator & operator=(const BTreeNodeAllocator &rhs);
-
NodeStore _nodeStore;
using RefVector = vespalib::Array<BTreeNode::Ref>;
@@ -53,6 +49,8 @@ private:
RefVector _leafHoldUntilFreeze;
public:
+ BTreeNodeAllocator(const BTreeNodeAllocator &rhs) = delete;
+ BTreeNodeAllocator & operator=(const BTreeNodeAllocator &rhs) = delete;
BTreeNodeAllocator();
~BTreeNodeAllocator();
diff --git a/vespalib/src/vespa/vespalib/geo/zcurve.cpp b/vespalib/src/vespa/vespalib/geo/zcurve.cpp
index c207f966704..d04a04fda0a 100644
--- a/vespalib/src/vespa/vespalib/geo/zcurve.cpp
+++ b/vespalib/src/vespa/vespalib/geo/zcurve.cpp
@@ -10,15 +10,38 @@ namespace vespalib::geo {
namespace {
+ /**
+ * An area defined by its upper left and lower right corners. The
+ * z-coordinates between these corners act as a spacial
+ * over-estimation of the actual area. These areas may never cross
+ * signed borders, since that would break the whole concept of
+ * hierarchical spatial partitioning.
+ **/
+struct Area {
+ const ZCurve::Point min;
+ const ZCurve::Point max;
+ Area(const Area &rhs) = default;
+ Area(int32_t min_x, int32_t min_y,
+ int32_t max_x, int32_t max_y)
+ : min(min_x, min_y), max(max_x, max_y)
+ {
+ assert((min_x <= max_x) && ((min_x < 0) == (max_x < 0)));
+ assert((min_y <= max_y) && ((min_y < 0) == (max_y < 0)));
+ }
+ Area &operator=(Area &&rhs) { new ((void*)this) Area(rhs); return *this; }
+ int64_t size() const { return (static_cast<int64_t>(max.x) - min.x + 1) * (static_cast<int64_t>(max.y) - min.y + 1); }
+ int64_t estimate() const { return (max.z - min.z + 1); }
+ int64_t error() const { return estimate() - size(); }
+};
+
class ZAreaQueue
{
private:
struct MaxAreaErrorCmp {
- bool operator()(const ZCurve::Area &a, const ZCurve::Area &b) const {
+ bool operator()(const Area &a, const Area &b) const {
return (a.error() > b.error());
}
};
- using Area = ZCurve::Area;
using Range = ZCurve::Range;
using RangeVector = ZCurve::RangeVector;
using Queue = PriorityQueue<Area, MaxAreaErrorCmp, LeftArrayHeap>;
@@ -61,7 +84,6 @@ public:
class ZAreaSplitter
{
private:
- using Area = ZCurve::Area;
using RangeVector = ZCurve::RangeVector;
ZAreaQueue _queue;
diff --git a/vespalib/src/vespa/vespalib/geo/zcurve.h b/vespalib/src/vespa/vespalib/geo/zcurve.h
index 2f92b3a019b..c5fbdc08dce 100644
--- a/vespalib/src/vespa/vespalib/geo/zcurve.h
+++ b/vespalib/src/vespa/vespalib/geo/zcurve.h
@@ -3,7 +3,6 @@
#pragma once
#include <cstdint>
-#include <cassert>
#include <vector>
namespace vespalib::geo {
@@ -163,30 +162,6 @@ public:
Point(int32_t x_, int32_t y_) : x(x_), y(y_), z(encode(x_, y_)) {}
};
- /**
- * An area defined by its upper left and lower right corners. The
- * z-coordinates between these corners act as a spacial
- * over-estimation of the actual area. These areas may never cross
- * signed borders, since that would break the whole concept of
- * hierarchical spatial partitioning.
- **/
- struct Area {
- const Point min;
- const Point max;
- Area(const Area &rhs) = default;
- Area(int32_t min_x, int32_t min_y,
- int32_t max_x, int32_t max_y)
- : min(min_x, min_y), max(max_x, max_y)
- {
- assert((min_x <= max_x) && ((min_x < 0) == (max_x < 0)));
- assert((min_y <= max_y) && ((min_y < 0) == (max_y < 0)));
- }
- Area &operator=(Area &&rhs) { new ((void*)this) Area(rhs); return *this; }
- int64_t size() const { return (static_cast<int64_t>(max.x) - min.x + 1) * (static_cast<int64_t>(max.y) - min.y + 1); }
- int64_t estimate() const { return (max.z - min.z + 1); }
- int64_t error() const { return estimate() - size(); }
- };
-
class Range
{
private:
@@ -212,11 +187,9 @@ public:
static RangeVector find_ranges(int min_x, int min_y,
int max_x, int max_y);
- static int64_t
- encodeSlow(int32_t x, int32_t y);
+ static int64_t encodeSlow(int32_t x, int32_t y);
- static void
- decodeSlow(int64_t enc, int32_t *xp, int32_t *yp);
+ static void decodeSlow(int64_t enc, int32_t *xp, int32_t *yp);
};
}
diff --git a/vespalib/src/vespa/vespalib/metrics/simple_metrics_manager.cpp b/vespalib/src/vespa/vespalib/metrics/simple_metrics_manager.cpp
index 4b6b82697f7..534177e480a 100644
--- a/vespalib/src/vespa/vespalib/metrics/simple_metrics_manager.cpp
+++ b/vespalib/src/vespa/vespalib/metrics/simple_metrics_manager.cpp
@@ -1,6 +1,7 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "simple_metrics_manager.h"
#include "simple_tick.h"
+#include <cassert>
#include <vespa/log/log.h>
LOG_SETUP(".vespalib.metrics.simple_metrics_manager");
diff --git a/vespalib/src/vespa/vespalib/metrics/stable_store.h b/vespalib/src/vespa/vespalib/metrics/stable_store.h
index f249fd7729e..d456150ab7e 100644
--- a/vespalib/src/vespa/vespalib/metrics/stable_store.h
+++ b/vespalib/src/vespa/vespalib/metrics/stable_store.h
@@ -4,7 +4,6 @@
#include <memory>
#include <vector>
-#include <assert.h>
namespace vespalib {
@@ -54,8 +53,8 @@ private:
StableStore(size_t sz, UP &&more, std::vector<T> &&mine);
- size_t _size;
- UP _more;
+ size_t _size;
+ UP _more;
std::vector<T> _mine;
};
diff --git a/vespalib/src/vespa/vespalib/util/fiddle.h b/vespalib/src/vespa/vespalib/util/fiddle.h
index f4d2ac33695..b6799d9c778 100644
--- a/vespalib/src/vespa/vespalib/util/fiddle.h
+++ b/vespalib/src/vespa/vespalib/util/fiddle.h
@@ -4,8 +4,7 @@
#include <cassert>
-namespace vespalib {
-namespace bits {
+namespace vespalib::bits {
//-----------------------------------------------------------------------------
@@ -79,6 +78,5 @@ uint32_t split_range(uint32_t min, uint32_t max,
//-----------------------------------------------------------------------------
-} // namespace bits
-} // namespace vespalib
+}
diff --git a/vespalib/src/vespa/vespalib/util/latch.h b/vespalib/src/vespa/vespalib/util/latch.h
index 3ae49aeb11f..9110b898372 100644
--- a/vespalib/src/vespa/vespalib/util/latch.h
+++ b/vespalib/src/vespa/vespalib/util/latch.h
@@ -4,7 +4,6 @@
#include <mutex>
#include <condition_variable>
-#include <cassert>
namespace vespalib {