MINOR: Optimize KTable-KTable join value getter supplier
Reviewers: Guozhang Wang Damian Guy Matthias J. Sax
package org.apache.kafka.streams.kstream.internals;
import java.util.ArrayList;
+import java.util.Collections;
public abstract class KTableKTableAbstractJoinValueGetterSupplier<K, R, V1, V2> implements KTableValueGetterSupplier<K, R> {
final KTableValueGetterSupplier<K, V1> valueGetterSupplier1;
@@ -33,12 +34,8 @@ public abstract class KTableKTableAbstractJoinValueGetterSupplier<K, R, V1, V2>
final String[] storeNames1 = valueGetterSupplier1.storeNames();
final String[] storeNames2 = valueGetterSupplier2.storeNames();
final ArrayList<String> stores = new ArrayList<>(storeNames1.length + storeNames2.length);
- for (final String storeName : storeNames1) {
- stores.add(storeName);
- }
- for (final String storeName : storeNames2) {
- stores.add(storeName);
- }
+ Collections.addAll(stores, storeNames1);
+ Collections.addAll(stores, storeNames2);
return stores.toArray(new String[stores.size()]);
}
