ignore out of bounds values in RandomLocator

This commit is contained in:
dfsek
2021-12-16 10:46:54 -07:00
parent 6c8b8a3d51
commit 0aa10a631a

View File

@@ -41,7 +41,9 @@ public class RandomLocator implements Locator {
BinaryColumn results = new BinaryColumn(column.getMinY(), column.getMaxY());
for(int i = 0; i < size; i++) {
results.set(height.get(r));
int h = height.get(r);
if(h >= column.getMaxY() || h < column.getMinY()) continue;
results.set(h);
}
return results;