diff --git a/nvbench/axes_metadata.cxx b/nvbench/axes_metadata.cxx index ef51a96..188c689 100644 --- a/nvbench/axes_metadata.cxx +++ b/nvbench/axes_metadata.cxx @@ -17,15 +17,15 @@ */ #include - #include -#include -#include - #include +#include #include +#include +#include + namespace nvbench { @@ -52,21 +52,18 @@ axes_metadata &axes_metadata::operator=(const axes_metadata &other) void axes_metadata::set_type_axes_names(std::vector names) try { - if (names.size() < m_axes.size()) + if (names.size() != m_axes.size()) { NVBENCH_THROW(std::runtime_error, - "Number of names exceeds number of axes ({}).", + "Number of type axis names ({}) exceeds number of type axes ({}).", + names.size(), m_axes.size()); } for (std::size_t i = 0; i < names.size(); ++i) { auto &axis = *m_axes[i]; - if (axis.get_type() != nvbench::axis_type::type) - { - NVBENCH_THROW(std::runtime_error, "Number of names exceeds number of type axes ({})", i); - } - + assert(axis.get_type() != nvbench::axis_type::type); axis.set_name(std::move(names[i])); } }