Skip to content

Commit

Permalink
Change code style of ArrayList
Browse files Browse the repository at this point in the history
  • Loading branch information
mouse0w0 committed Feb 14, 2024
1 parent c09089c commit fa7af79
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions drv/ArrayList.drv
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,8 @@ public class ARRAY_LIST KEY_GENERIC extends ABSTRACT_LIST KEY_GENERIC implements
@Override
public int indexOf(final KEY_TYPE k) {
final KEY_TYPE[] a = this.a;
for(int i = 0, max = size; i < max; i++) if (KEY_EQUALS(k, a[i])) return i;
final int size = this.size;
for(int i = 0; i < size; i++) if (KEY_EQUALS(k, a[i])) return i;
return -1;
}

Expand Down Expand Up @@ -632,7 +633,8 @@ public class ARRAY_LIST KEY_GENERIC extends ABSTRACT_LIST KEY_GENERIC implements
@Override
public void forEach(final METHOD_ARG_KEY_CONSUMER action) {
final KEY_GENERIC_TYPE[] a = ARRAY_LIST.this.a;
for (int i = from, max = to; i < max; ++i) {
final int to = this.to;
for (int i = from; i < to; ++i) {
action.accept(a[i]);
}
}
Expand Down Expand Up @@ -875,7 +877,8 @@ public class ARRAY_LIST KEY_GENERIC extends ABSTRACT_LIST KEY_GENERIC implements
@Override
public void forEach(final METHOD_ARG_KEY_CONSUMER action) {
final KEY_GENERIC_TYPE[] a = this.a;
for (int i = 0, max = size; i < max; ++i) {
final int size = this.size;
for (int i = 0; i < size; ++i) {
action.accept(a[i]);
}
}
Expand Down Expand Up @@ -1019,12 +1022,12 @@ public class ARRAY_LIST KEY_GENERIC extends ABSTRACT_LIST KEY_GENERIC implements
@Override
public void forEachRemaining(final METHOD_ARG_KEY_CONSUMER action) {
final KEY_GENERIC_TYPE[] a = ARRAY_LIST.this.a;
final int max = ARRAY_LIST.this.size;
for (int i = pos; i < max; i++) {
final int size = ARRAY_LIST.this.size;
for (int i = pos; i < size; i++) {
action.accept(a[i]);
}
pos = max;
last = max - 1;
pos = size;
last = size - 1;
}
@Override
public int back(int n) {
Expand Down

0 comments on commit fa7af79

Please sign in to comment.