summaryrefslogtreecommitdiff
path: root/src/sample_selection.cc
diff options
context:
space:
mode:
authorAndré Nusser <anusser@mpi-inf.mpg.de>2021-05-22 22:08:19 +0200
committerAndré Nusser <anusser@mpi-inf.mpg.de>2021-05-22 22:08:19 +0200
commit24856ea494f6b3a84bc3d3d313a57b1882181913 (patch)
tree4c115a66a1f8540df59976a2bfb81955a8b9638b /src/sample_selection.cc
parent0fcb75e864ff8ed42622249dfdd7af9abfda033d (diff)
Add assert to break infinite loop in case of a bug.
Diffstat (limited to 'src/sample_selection.cc')
-rw-r--r--src/sample_selection.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/sample_selection.cc b/src/sample_selection.cc
index 1195703..31313bb 100644
--- a/src/sample_selection.cc
+++ b/src/sample_selection.cc
@@ -103,6 +103,8 @@ const Sample* SampleSelection::get(level_t level, std::size_t pos)
{
DEBUG(rand, "%d %d", (int)up_index, (int)down_index);
+ assert(down_index <= up_index);
+
std::size_t current_index;
if (up_value_lb < down_value_lb)
{