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

Commit ebd88889 authored by Chia-I Wu's avatar Chia-I Wu
Browse files

surfaceflinger: simplify TimeStats::getInstance

A static variable suffices.  And since TimeStats::getInstance is
always called, there is no need to put it on heap.

Test: boots
Change-Id: I954cfb18a6610f039b36c80946e32a7dc3a62a68
parent 304007e2
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -32,11 +32,8 @@
namespace android {

TimeStats& TimeStats::getInstance() {
    static std::unique_ptr<TimeStats> sInstance;
    static std::once_flag sOnceFlag;

    std::call_once(sOnceFlag, [] { sInstance.reset(new TimeStats); });
    return *sInstance.get();
    static TimeStats sInstance;
    return sInstance;
}

void TimeStats::parseArgs(bool asProto, const Vector<String16>& args, size_t& index,