mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2026-02-08 10:40:16 +00:00
Fix UB when sorting empty vecs
This commit is contained in:
@@ -1847,7 +1847,7 @@ EX namespace hive {
|
||||
}
|
||||
}
|
||||
|
||||
hrandom_shuffle(&bugtomove[0], isize(bugtomove));
|
||||
hrandom_shuffle(bugtomove);
|
||||
sort(bugtomove.begin(), bugtomove.end());
|
||||
|
||||
int battlecount = 0;
|
||||
@@ -3611,7 +3611,7 @@ EX namespace windmap {
|
||||
vector<bool> inqueue(N, true);
|
||||
vector<int> tocheck;
|
||||
for(int i=0; i<N; i++) tocheck.push_back(i);
|
||||
hrandom_shuffle(&tocheck[0], isize(tocheck));
|
||||
hrandom_shuffle(tocheck);
|
||||
|
||||
for(int a=0; a<isize(tocheck); a++) {
|
||||
if(a >= 200*N) { printf("does not converge\n"); break; }
|
||||
|
||||
Reference in New Issue
Block a user