Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3b4afb95 authored by Nikolas Havrikov's avatar Nikolas Havrikov
Browse files

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
parent dbb79760
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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) {
+1 −1
Original line number Diff line number Diff line
@@ -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();
    }