Replace LinkedList by a more performant collection

This is a semi-automatic change.
See https://errorprone.info/bugpattern/JdkObsolete for the rationale.

Test: make
Bug: 221046110
Change-Id: I5754bbc8fbde2167512994cacccc4417319a1fc2
This commit is contained in:
Nikolas Havrikov
2022-02-23 16:20:36 +01:00
parent dbb7976008
commit 3b4afb9578
2 changed files with 4 additions and 4 deletions

View File

@@ -180,7 +180,7 @@ public class EventManager {
}
}
private final List<Event> mEvents = Collections.synchronizedList(new LinkedList<>());
private final List<Event> mEvents = Collections.synchronizedList(new ArrayList<>());
private final Loggable mRecordEntry;
public EventRecord(Loggable recordEntry) {
@@ -197,7 +197,7 @@ public class EventManager {
}
public List<Event> getEvents() {
return new LinkedList<>(mEvents);
return new ArrayList<>(mEvents);
}
public List<EventTiming> extractEventTimings() {
@@ -205,7 +205,7 @@ public class EventManager {
return Collections.emptyList();
}
LinkedList<EventTiming> result = new LinkedList<>();
ArrayList<EventTiming> result = new ArrayList<>();
Map<String, PendingResponse> pendingResponses = new HashMap<>();
synchronized (mEvents) {
for (Event event : mEvents) {

View File

@@ -359,7 +359,7 @@ public class ParcelableCallAnalytics implements Parcelable {
eventTimings = new ArrayList<>();
in.readTypedList(eventTimings, EventTiming.CREATOR);
isVideoCall = readByteAsBoolean(in);
videoEvents = new LinkedList<>();
videoEvents = new ArrayList<>();
in.readTypedList(videoEvents, VideoEvent.CREATOR);
callSource = in.readInt();
}