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
diff --git a/cmds/lshal/Lshal.cpp b/cmds/lshal/Lshal.cpp
index 9e60461..a9596d7 100644
--- a/cmds/lshal/Lshal.cpp
+++ b/cmds/lshal/Lshal.cpp
@@ -160,14 +160,14 @@
}
void Lshal::forEachTable(const std::function<void(Table &)> &f) {
- for (const Table &table : {mServicesTable, mPassthroughRefTable, mImplementationsTable}) {
- f(const_cast<Table &>(table));
- }
+ f(mServicesTable);
+ f(mPassthroughRefTable);
+ f(mImplementationsTable);
}
void Lshal::forEachTable(const std::function<void(const Table &)> &f) const {
- for (const Table &table : {mServicesTable, mPassthroughRefTable, mImplementationsTable}) {
- f(table);
- }
+ f(mServicesTable);
+ f(mPassthroughRefTable);
+ f(mImplementationsTable);
}
void Lshal::postprocess() {