From 94b8a3225dd2338b8e81c1fb8230f903bb50b1da Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Wed, 17 May 2023 19:23:45 +0000 Subject: GC unused assert includes --- .../src/vespa/vespalib/btree/btreenodeallocator.h | 6 ++--- vespalib/src/vespa/vespalib/geo/zcurve.cpp | 28 ++++++++++++++++--- vespalib/src/vespa/vespalib/geo/zcurve.h | 31 ++-------------------- .../vespalib/metrics/simple_metrics_manager.cpp | 1 + vespalib/src/vespa/vespalib/metrics/stable_store.h | 5 ++-- vespalib/src/vespa/vespalib/util/fiddle.h | 6 ++--- vespalib/src/vespa/vespalib/util/latch.h | 1 - 7 files changed, 34 insertions(+), 44 deletions(-) (limited to 'vespalib') 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; @@ -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(max.x) - min.x + 1) * (static_cast(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; @@ -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 -#include #include 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(max.x) - min.x + 1) * (static_cast(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 #include 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 #include -#include namespace vespalib { @@ -54,8 +53,8 @@ private: StableStore(size_t sz, UP &&more, std::vector &&mine); - size_t _size; - UP _more; + size_t _size; + UP _more; std::vector _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 -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 #include -#include namespace vespalib { -- cgit v1.2.3