diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2023-07-27 14:39:21 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2023-07-27 14:39:21 +0000 |
commit | 1b21aebee4e4158a398a6fbf9bcf61f77ac6df21 (patch) | |
tree | fdbfb2a8ed35fa0f9649f868d5a35b4908880e4d | |
parent | 018bcfcb2640fd7758d8a4f21510fd1f8a508f35 (diff) |
- Return double for computation.
- Do not hide narrowing to 32 bit.
- Use enum class.
3 files changed, 5 insertions, 5 deletions
diff --git a/searchlib/src/vespa/searchcommon/attribute/distance_metric.h b/searchlib/src/vespa/searchcommon/attribute/distance_metric.h index 35f5fb4fe6b..7c04fbda608 100644 --- a/searchlib/src/vespa/searchcommon/attribute/distance_metric.h +++ b/searchlib/src/vespa/searchcommon/attribute/distance_metric.h @@ -6,6 +6,6 @@ namespace search::attribute { -enum DistanceMetric : uint8_t { Euclidean, Angular, GeoDegrees, InnerProduct, Hamming, PrenormalizedAngular, Dotproduct }; +enum class DistanceMetric : uint8_t { Euclidean, Angular, GeoDegrees, InnerProduct, Hamming, PrenormalizedAngular, Dotproduct }; } diff --git a/vespalib/src/vespa/vespalib/datastore/compaction_strategy.h b/vespalib/src/vespa/vespalib/datastore/compaction_strategy.h index c0c1857deae..dd41ed244ae 100644 --- a/vespalib/src/vespa/vespalib/datastore/compaction_strategy.h +++ b/vespalib/src/vespa/vespalib/datastore/compaction_strategy.h @@ -56,10 +56,10 @@ public: _active_buffers_ratio(active_buffers_ratio), _max_buffers(max_buffers) { } - float getMaxDeadBytesRatio() const noexcept { return _maxDeadBytesRatio; } - float getMaxDeadAddressSpaceRatio() const noexcept { return _maxDeadAddressSpaceRatio; } + double getMaxDeadBytesRatio() const noexcept { return _maxDeadBytesRatio; } + double getMaxDeadAddressSpaceRatio() const noexcept { return _maxDeadAddressSpaceRatio; } uint32_t get_max_buffers() const noexcept { return _max_buffers; } - float get_active_buffers_ratio() const noexcept { return _active_buffers_ratio; } + double get_active_buffers_ratio() const noexcept { return _active_buffers_ratio; } bool operator==(const CompactionStrategy & rhs) const noexcept { return (_maxDeadBytesRatio == rhs._maxDeadBytesRatio) && (_maxDeadAddressSpaceRatio == rhs._maxDeadAddressSpaceRatio) && diff --git a/vespalib/src/vespa/vespalib/util/growstrategy.h b/vespalib/src/vespa/vespalib/util/growstrategy.h index 643e3f03023..900c87c6cdf 100644 --- a/vespalib/src/vespa/vespalib/util/growstrategy.h +++ b/vespalib/src/vespa/vespalib/util/growstrategy.h @@ -18,7 +18,7 @@ public: GrowStrategy() noexcept : GrowStrategy(1024, 0.5, 0, 0) {} - GrowStrategy(size_t initialCapacity, float growPercent, size_t growDelta, size_t minimumCapacity) noexcept + GrowStrategy(uint32_t initialCapacity, float growPercent, uint32_t growDelta, uint32_t minimumCapacity) noexcept : _initialCapacity(initialCapacity), _minimumCapacity(minimumCapacity), _growDelta(growDelta), |