diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-04-03 20:22:16 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-04-04 16:36:18 +0200 |
commit | 5a48a81c4134bae524aa66e1e49624f678c8b6ce (patch) | |
tree | 04cf54e814d86a98cd5407510981edb28736dcc3 /vespalib/src/tests/left_right_heap | |
parent | d57ddaefd37e6a19d3a6937fbf9a655dbafcdba5 (diff) |
Add override in vespalib module
Diffstat (limited to 'vespalib/src/tests/left_right_heap')
-rw-r--r-- | vespalib/src/tests/left_right_heap/left_right_heap_bench.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/vespalib/src/tests/left_right_heap/left_right_heap_bench.cpp b/vespalib/src/tests/left_right_heap/left_right_heap_bench.cpp index 5699adfb760..cc9f586f806 100644 --- a/vespalib/src/tests/left_right_heap/left_right_heap_bench.cpp +++ b/vespalib/src/tests/left_right_heap/left_right_heap_bench.cpp @@ -1,13 +1,8 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -#include <vespa/fastos/fastos.h> #include <vespa/vespalib/testkit/test_kit.h> #include <vespa/vespalib/util/left_right_heap.h> #include <vespa/vespalib/util/stringfmt.h> #include <vespa/vespalib/util/inline.h> -#include <stdlib.h> -#include <algorithm> -#include <vector> -#include <memory> using namespace vespalib; @@ -210,10 +205,10 @@ struct Benchmark { template <typename H, typename D> struct BenchmarkHD : Benchmark { - virtual std::string legend() const { + std::string legend() const override { return make_string("[%s, %s]", Name<H>::value(), D::name()); } - virtual double fiddle(size_t heapSize, size_t cnt, size_t loop, bool adjust) { + double fiddle(size_t heapSize, size_t cnt, size_t loop, bool adjust) override { Timer t; for (size_t i = 0; i < loop; ++i) { D d(cnt * 2); @@ -224,7 +219,7 @@ struct BenchmarkHD : Benchmark { } return t.minTime; } - virtual std::pair<double, double> sort(size_t maxHeapSize, size_t loop) { + std::pair<double, double> sort(size_t maxHeapSize, size_t loop) override { Timer t1; Timer t2; for (size_t i = 0; i < loop; ++i) { @@ -236,12 +231,12 @@ struct BenchmarkHD : Benchmark { } return std::make_pair(t1.minTime, t2.minTime); } - virtual void runSortBench(size_t maxHeapSize, size_t loop) { + void runSortBench(size_t maxHeapSize, size_t loop) override { std::pair<double, double> t = sort(maxHeapSize, loop); fprintf(stderr, " sort bench (size=%zu): %g ms [%g ms (push) %g ms (pop)]\n", maxHeapSize, (t.first + t.second), t.first, t.second); } - virtual void runFiddleBench(size_t heapSize, size_t cnt, size_t loop, bool adjust) { + void runFiddleBench(size_t heapSize, size_t cnt, size_t loop, bool adjust) override { double t = fiddle(heapSize, cnt, loop, adjust); fprintf(stderr, " fiddle bench (size=%zu, cnt=%zu, use adjust='%s'): %g ms\n", heapSize, cnt, adjust? "yes":"no", t); |