diff --git a/packages/CLPBN/horus/TinySet.h b/packages/CLPBN/horus/TinySet.h index 4535eda02..2c7d113b4 100644 --- a/packages/CLPBN/horus/TinySet.h +++ b/packages/CLPBN/horus/TinySet.h @@ -228,9 +228,12 @@ class TinySet private: iterator unique_cmp (iterator first, iterator last) { + if (first == last) { + return last; + } iterator result = first; while (++first != last) { - if ( cmp_(*result, *first)) { + if (cmp_(*result, *first)) { *(++result) = *first; } }