From 255192edd49cfe36557f7f4f0d2d6ee1c702ffbb Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Tue, 23 Apr 2024 00:37:02 -0500 Subject: [PATCH] Prevent STL from complaining with https://github.com/freebayes/freebayes/issues/786 --- multichoose.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/multichoose.h b/multichoose.h index 51acb24..1e19a69 100644 --- a/multichoose.h +++ b/multichoose.h @@ -1,7 +1,7 @@ #ifndef __MULTICHOOSE_H #define __MULTICHOOSE_H -/* +/* multichoose.h -- n multichoose k for generic vectors @@ -58,7 +58,10 @@ std::vector< std::vector > multichoose(int k, std::vector& objects) { multiset.push_back(*a[i]); choices.push_back(multiset); j=k; - do { j--; } while(a[j]==b[j]); + do { + j--; + if (j<0) break; + } while(a[j]==b[j]); if (j<0) break; j_1=j; while(j_1<=k-1){ @@ -72,7 +75,7 @@ std::vector< std::vector > multichoose(int k, std::vector& objects) { j_1=q; } } - + return choices; }