diff --git a/ex01/src/Span.cpp b/ex01/src/Span.cpp index 4a547c8..620cfdd 100644 --- a/ex01/src/Span.cpp +++ b/ex01/src/Span.cpp @@ -41,7 +41,7 @@ int Span::shortestSpan() const int Span::longestSpan() const { - if (this->_vector.size() == 0) + if (this->_vector.size() < 2) throw std::exception(); return *std::max_element(this->_vector.begin(), this->_vector.end()) - *std::min_element(this->_vector.begin(), this->_vector.end()); }