Commit 4ce6d91 1 parent 1f0516d commit 4ce6d91 Copy full SHA for 4ce6d91
File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -98,12 +98,12 @@ private static int[] calcSmallestPrimeFactors(int[] primes) {
98
98
99
99
100
100
private static long [] calcPrimePowersAndTotients (int [] primes ) {
101
- DynamicArray temp = new DynamicArray (primes .length * 2 );
101
+ LongList temp = new LongList (primes .length * 2 );
102
102
for (int p : primes ) {
103
103
if (p == 2 || p == 5 )
104
104
continue ;
105
105
for (long pow = p , tot = p - 1 ; pow <= LIMIT ; pow *= p , tot *= p )
106
- temp .add (pow << 32 | tot );
106
+ temp .append (pow << 32 | tot );
107
107
}
108
108
long [] result = temp .toArray ();
109
109
Arrays .sort (result );
@@ -170,21 +170,21 @@ private static int lcm(int x, int y) {
170
170
171
171
172
172
// A growable list of long values that is more time- and space-efficient than java.util.List<Long>
173
- private static class DynamicArray {
173
+ private static class LongList {
174
174
175
175
private long [] data ;
176
176
private int length ;
177
177
178
178
179
- public DynamicArray (int initCapacity ) {
179
+ public LongList (int initCapacity ) {
180
180
if (initCapacity < 1 )
181
181
throw new IllegalArgumentException ();
182
182
data = new long [initCapacity ];
183
183
length = 0 ;
184
184
}
185
185
186
186
187
- public void add (long x ) {
187
+ public void append (long x ) {
188
188
if (length == data .length )
189
189
data = Arrays .copyOf (data , length * 2 );
190
190
data [length ] = x ;
You can’t perform that action at this time.
0 commit comments