Merge "Replace LinkedList by a more performant collection"

This commit is contained in:
TreeHugger Robot
2022-02-24 16:23:43 +00:00
committed by Android (Google) Code Review
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();
}