[C++] Fix unsigned integer check in Solution.h#1850
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1850 +/- ##
==========================================
- Coverage 74.41% 74.40% -0.01%
==========================================
Files 386 386
Lines 53628 53630 +2
Branches 9063 9064 +1
==========================================
Hits 39905 39905
- Misses 10652 10653 +1
- Partials 3071 3072 +1 ☔ View full report in Codecov by Sentry. |
|
@g3bk47 ... thanks for the PR!
No: it is not guaranteed to have at least one element. Indeed, it will have zero entries in most cases. As this case isn't adequately covered in |
|
@ischoegl I extended |
Changes proposed in this pull request
Remove check for negative index value and use the
IndexErrorexception type in Solution.h.Closes #1849.
Before merging the PR: Is
m_adjacentguaranteed to have at least one element? Otherwise, the maximum allowed index (last parameter inIndexError's constructor) should probably be handled differently form_adjacent.size() == 0.Checklist
scons build&scons test) and unit tests address code coverage