Skip to content

Commit

Permalink
small improvement to object creation
Browse files Browse the repository at this point in the history
  • Loading branch information
rakow committed Mar 3, 2024
1 parent e62ffce commit febd686
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,8 @@ public double nextDouble() {

for (int i = 0; i < result.length; i++) {

byte[] path = Arrays.copyOf(entry.modes, entry.modes.length);

byte mode = -1;
byte originalMode = path[i];
byte originalMode = entry.modes[i];

// This mode had no options
if (originalMode == -1)
Expand All @@ -215,8 +213,9 @@ public double nextDouble() {
}
}

path[i] = mode;
if (mode != -1) {
byte[] path = Arrays.copyOf(entry.modes, entry.modes.length);
path[i] = mode;

// recompute the deviation from the maximum
// there might be a way to store and update this, without recomputing
Expand Down

0 comments on commit febd686

Please sign in to comment.