From f2e7c7ebd604e9ab2e31a614b10af90c9d9bca30 Mon Sep 17 00:00:00 2001 From: TobiGr Date: Sun, 14 Mar 2021 01:05:58 +0100 Subject: [PATCH] Replace Vector with ArrayList for performance improvements I could not figure out, why these two methods are necessary. --- .../newpipe/extractor/comments/CommentsInfoItemsCollector.java | 3 ++- .../newpipe/extractor/stream/StreamInfoItemsCollector.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/comments/CommentsInfoItemsCollector.java b/extractor/src/main/java/org/schabi/newpipe/extractor/comments/CommentsInfoItemsCollector.java index 2fc0faef9..5a1b88489 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/comments/CommentsInfoItemsCollector.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/comments/CommentsInfoItemsCollector.java @@ -4,6 +4,7 @@ import org.schabi.newpipe.extractor.InfoItem; import org.schabi.newpipe.extractor.InfoItemsCollector; import org.schabi.newpipe.extractor.exceptions.ParsingException; +import java.util.ArrayList; import java.util.List; import java.util.Vector; @@ -95,7 +96,7 @@ public class CommentsInfoItemsCollector extends InfoItemsCollector getCommentsInfoItemList() { - List siiList = new Vector<>(); + List siiList = new ArrayList<>(); for (InfoItem ii : super.getItems()) { if (ii instanceof CommentsInfoItem) { siiList.add((CommentsInfoItem) ii); diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfoItemsCollector.java b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfoItemsCollector.java index 1e6e6e91b..464653a9d 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfoItemsCollector.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/stream/StreamInfoItemsCollector.java @@ -5,6 +5,7 @@ import org.schabi.newpipe.extractor.InfoItemsCollector; import org.schabi.newpipe.extractor.exceptions.FoundAdException; import org.schabi.newpipe.extractor.exceptions.ParsingException; +import java.util.ArrayList; import java.util.Comparator; import java.util.List; import java.util.Vector; @@ -111,7 +112,7 @@ public class StreamInfoItemsCollector extends InfoItemsCollector getStreamInfoItemList() { - List siiList = new Vector<>(); + List siiList = new ArrayList<>(); for (InfoItem ii : super.getItems()) { if (ii instanceof StreamInfoItem) { siiList.add((StreamInfoItem) ii);