Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
yrik authored Sep 30, 2021
1 parent e8d8e51 commit 1568d18
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ async function generateImages() {
let id = 0;
await generateWeightedTraits();
if (config.deleteDuplicates) {
while (weightedTraits[0].length > 0 && noMoreMatches < 20000) {
while (!Object.values(weightedTraits).filter(arr => arr.length == 0).length && noMoreMatches < 20000) {
let picked = [];
order.forEach(id => {
let pickedImgId = pickRandom(weightedTraits[id]);
Expand All @@ -392,7 +392,7 @@ async function generateImages() {
}
}
} else {
while (weightedTraits[0].length > 0) {
while (!Object.values(weightedTraits).filter(arr => arr.length == 0).length) {
order.forEach(id => {
images.push(
basePath + traits[id] + '/' + pickRandomAndRemove(weightedTraits[id])
Expand Down

0 comments on commit 1568d18

Please sign in to comment.