summaryrefslogtreecommitdiffstats
path: root/logd/LogStatistics.cpp
diff options
context:
space:
mode:
authorMark Salyzyn <salyzyn@google.com>2015-05-19 09:12:30 -0700
committerMark Salyzyn <salyzyn@google.com>2015-06-04 11:03:37 -0700
commit6f1457adc58644f7c68829fd0872947bd7e63bfd (patch)
tree2e39d69d7ee3e3a3126202efa6e7bb9539c75291 /logd/LogStatistics.cpp
parent5d332907f0f845227847c31a122578dc910f1072 (diff)
downloadsystem_core-6f1457adc58644f7c68829fd0872947bd7e63bfd.tar.gz
system_core-6f1457adc58644f7c68829fd0872947bd7e63bfd.tar.bz2
system_core-6f1457adc58644f7c68829fd0872947bd7e63bfd.zip
logd: switch to unordered_map from BasicHashtable
(charry pick from commit 511338dd575572d567c04d69eaea60627b6c3452) BasicHashtable is relatively untested, move over to a C++ template library that has more bake time. Bug: 20419786 Bug: 21590652 Bug: 20500228 Change-Id: I926aaecdc8345eca75c08fdd561b0473504c5d95
Diffstat (limited to 'logd/LogStatistics.cpp')
-rw-r--r--logd/LogStatistics.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/logd/LogStatistics.cpp b/logd/LogStatistics.cpp
index 90c49c0ee..48c2fe66e 100644
--- a/logd/LogStatistics.cpp
+++ b/logd/LogStatistics.cpp
@@ -161,9 +161,8 @@ char *LogStatistics::uidToName(uid_t uid) {
}
// report uid -> pid(s) -> pidToName if unique
- ssize_t index = -1;
- while ((index = pidTable.next(index)) != -1) {
- const PidEntry &entry = pidTable.entryAt(index);
+ for(pidTable_t::iterator it = pidTable.begin(); it != pidTable.end(); ++it) {
+ const PidEntry &entry = it->second;
if (entry.getUid() == uid) {
const char *n = entry.getName();
@@ -520,12 +519,12 @@ uid_t pidToUid(pid_t pid) {
}
uid_t LogStatistics::pidToUid(pid_t pid) {
- return pidTable.entryAt(pidTable.add(pid)).getUid();
+ return pidTable.add(pid)->second.getUid();
}
// caller must free character string
char *LogStatistics::pidToName(pid_t pid) {
- const char *name = pidTable.entryAt(pidTable.add(pid)).getName();
+ const char *name = pidTable.add(pid)->second.getName();
if (!name) {
return NULL;
}