Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 46fda3d

Browse files
committed
VisualSortArray: Renamed a private field.
1 parent bfd4cf6 commit 46fda3d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

‎src/io/nayuki/sortalgodemo/visual/VisualSortArray.java‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ final class VisualSortArray extends AbstractSortArray {
4040
private boolean isInitialized = false;
4141

4242
// Visual state per element: 0=active, 1=inactive, 2=comparing, 3=done
43-
private int[] state;
43+
private int[] states;
4444

4545
private volatile boolean isDone;
4646

@@ -68,7 +68,7 @@ public VisualSortArray(int size, double speed) {
6868
throw new IllegalArgumentException();
6969
stepsPerSecond = speed;
7070
stepsPerCheck = (int)Math.max(Math.min(stepsPerSecond * CHECK_INTERVAL_NS / 1e9, 1_000_000), 1);
71-
state = new int[size];
71+
states = new int[size];
7272
}
7373

7474

@@ -124,13 +124,13 @@ public void swap(int i, int j) {
124124

125125
public void setElement(int index, ElementState state) {
126126
Objects.requireNonNull(state);
127-
this.state[index] = state.ordinal();
127+
this.states[index] = state.ordinal();
128128
}
129129

130130

131131
public void setRange(int start, int end, ElementState state) {
132132
Objects.requireNonNull(state);
133-
Arrays.fill(this.state, start, end, state.ordinal());
133+
Arrays.fill(states, start, end, state.ordinal());
134134
}
135135

136136

@@ -140,7 +140,7 @@ public int getValue(int index) {
140140

141141

142142
public int getState(int index) {
143-
return state[index];
143+
return states[index];
144144
}
145145

146146

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /