Skip to content

Commit

Permalink
fixed potential infinite loop for categories argument with uneven gro…
Browse files Browse the repository at this point in the history
…up sizes
  • Loading branch information
m-Py committed Jun 22, 2023
1 parent 1475bbc commit 435958a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions R/sample-by-category.R
Expand Up @@ -132,6 +132,9 @@ gcd_set <- function(x) {
if (all(x == x[1])) {
gdc_found <- TRUE
}
if (any(x == 1)) { # cannot find a greated common denominator!
return(1)
}
}
x[1]
}

0 comments on commit 435958a

Please sign in to comment.