Fixed checks for less than 0 on List indexing, as it was always false.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-08-20 13:27:39 +02:00
parent 675407d7f5
commit fedb27790e
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 2 additions and 2 deletions

View File

@ -36,7 +36,7 @@ namespace ArbUt {
inline const const_reference& At(size_t index) const { inline const const_reference& At(size_t index) const {
#ifndef NO_ASSERT #ifndef NO_ASSERT
if (index >= _vector.size() || index < 0) { if (index >= _vector.size()) {
std::stringstream ss; std::stringstream ss;
ss << "Index " << index << " is out of bounds."; ss << "Index " << index << " is out of bounds.";
throw ArbUt::Exception(ss.str()); throw ArbUt::Exception(ss.str());
@ -47,7 +47,7 @@ namespace ArbUt {
inline const const_reference& Set(size_t index, const ValueT& value) { inline const const_reference& Set(size_t index, const ValueT& value) {
#ifndef NO_ASSERT #ifndef NO_ASSERT
if (index >= _vector.size() || index < 0) { if (index >= _vector.size()) {
std::stringstream ss; std::stringstream ss;
ss << "Index " << index << " is out of bounds."; ss << "Index " << index << " is out of bounds.";
throw ArbUt::Exception(ss.str()); throw ArbUt::Exception(ss.str());