Skip to content

Commit

Permalink
Avoid new ArrayList(collection) in Registry
Browse files Browse the repository at this point in the history
Fixes #3296

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=213286385
  • Loading branch information
sjudd committed Sep 21, 2018
1 parent b3b2d7a commit 2ca790a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion library/src/main/java/com/bumptech/glide/Registry.java
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,9 @@ public <Data, TResource> Registry prepend(
// Final to avoid a PMD error.
@NonNull
public final Registry setResourceDecoderBucketPriorityList(@NonNull List<String> buckets) {
List<String> modifiedBuckets = new ArrayList<>(buckets);
// See #3296 and https://bugs.openjdk.java.net/browse/JDK-6260652.
List<String> modifiedBuckets = new ArrayList<>(buckets.size());
modifiedBuckets.addAll(buckets);
modifiedBuckets.add(0, BUCKET_PREPEND_ALL);
modifiedBuckets.add(BUCKET_APPEND_ALL);
decoderRegistry.setBucketPriorityList(modifiedBuckets);
Expand Down

0 comments on commit 2ca790a

Please sign in to comment.