aboutsummaryrefslogtreecommitdiffstats
path: root/src/cli/speed.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli/speed.cpp')
-rw-r--r--src/cli/speed.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/cli/speed.cpp b/src/cli/speed.cpp
index 397f0bde5..62edf0b75 100644
--- a/src/cli/speed.cpp
+++ b/src/cli/speed.cpp
@@ -320,7 +320,7 @@ std::string Timer::result_string_bps(const Timer& timer)
if(timer.buf_size() > 0)
{
- oss << " buffer size " << timer.buf_size();
+ oss << " buffer size " << timer.buf_size() << " bytes:";
}
oss << " " << std::fixed << std::setprecision(3) << MiB_per_sec << " MiB/sec";
@@ -648,7 +648,19 @@ class Speed final : public Command
{
try
{
- buf_sizes.push_back(static_cast<size_t>(std::stoul(size_str)));
+ auto new_buf_size = static_cast<size_t>(std::stoul(size_str));
+
+ auto it = std::find_if(buf_sizes.begin(), buf_sizes.end(),
+ [new_buf_size](size_t buf_size)
+ {
+ return buf_size == new_buf_size;
+ }
+ );
+
+ if(it == buf_sizes.end())
+ {
+ buf_sizes.insert(buf_sizes.end(), new_buf_size);
+ }
}
catch(std::exception&)
{
@@ -656,6 +668,8 @@ class Speed final : public Command
}
}
+ std::sort(buf_sizes.begin(), buf_sizes.end());
+
Botan::CPUID::initialize();
for(std::string cpuid_to_clear : Botan::split_on(get_arg("clear-cpuid"), ','))