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

Commit 8ab3bee8 authored by Yifan Hong's avatar Yifan Hong
Browse files

Fix forEachTable will copy the table.

std::initializer_list<T> has T deduced to Table, which will
copy the table. Use pointers instead.

Test: pass
Change-Id: I7da40eb0f5d0171244a9b9caacf37b41fe0af304
parent 074c1cd1
Loading
Loading
Loading
Loading
+6 −6
Original line number Original line Diff line number Diff line
@@ -160,14 +160,14 @@ bool Lshal::getReferencedPids(
}
}


void Lshal::forEachTable(const std::function<void(Table &)> &f) {
void Lshal::forEachTable(const std::function<void(Table &)> &f) {
    for (const Table &table : {mServicesTable, mPassthroughRefTable, mImplementationsTable}) {
    f(mServicesTable);
        f(const_cast<Table &>(table));
    f(mPassthroughRefTable);
    }
    f(mImplementationsTable);
}
}
void Lshal::forEachTable(const std::function<void(const Table &)> &f) const {
void Lshal::forEachTable(const std::function<void(const Table &)> &f) const {
    for (const Table &table : {mServicesTable, mPassthroughRefTable, mImplementationsTable}) {
    f(mServicesTable);
        f(table);
    f(mPassthroughRefTable);
    }
    f(mImplementationsTable);
}
}


void Lshal::postprocess() {
void Lshal::postprocess() {