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

Commit 0cde53ea authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Use push/peek/pop for operations on stack"

parents f256805d 5237f47b
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -52,12 +52,11 @@ public class BootTimingsTraceLog {
        if (!DEBUG_BOOT_TIME) {
            return;
        }
        // Pop the top element without throwing NoSuchElementException
        Pair<String, Long> event = mStartTimes.pollFirst();
        if (event == null) {
        if (mStartTimes.peek() == null) {
            Slog.w(mTag, "traceEnd called more times than traceBegin");
            return;
        }
        Pair<String, Long> event = mStartTimes.pop();
        // Log the duration so it can be parsed by external tools for performance reporting
        Slog.d(mTag, event.first + " took to complete: "
                + (SystemClock.elapsedRealtime() - event.second) + "ms");