Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xs/src/libslic3r/Config.hpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/xs/src/libslic3r/Config.hpp b/xs/src/libslic3r/Config.hpp
index 3fbd82060..6c8fa9f27 100644
--- a/xs/src/libslic3r/Config.hpp
+++ b/xs/src/libslic3r/Config.hpp
@@ -1,6 +1,7 @@
#ifndef slic3r_Config_hpp_
#define slic3r_Config_hpp_
+#include <assert.h>
#include <map>
#include <climits>
#include <cstdio>
@@ -73,11 +74,8 @@ class ConfigOptionVector : public ConfigOptionVectorBase
};
T get_at(size_t i) const {
- try {
- return this->values.at(i);
- } catch (const std::out_of_range& oor) {
- return this->values.front();
- }
+ assert(! this->values.empty());
+ return (i < this->values.size()) ? this->values[i] : this->values.front();
};
};