Merge "Do not inline rarely used trace function bodies."
diff --git a/logd/LogBuffer.cpp b/logd/LogBuffer.cpp
index 8c1c344..1c74ba5 100644
--- a/logd/LogBuffer.cpp
+++ b/logd/LogBuffer.cpp
@@ -147,7 +147,8 @@
     //  NB: if end is region locked, place element at end of list
     LogBufferElementCollection::iterator it = mLogElements.end();
     LogBufferElementCollection::iterator last = it;
-    while (--it != mLogElements.begin()) {
+    while (last != mLogElements.begin()) {
+        --it;
         if ((*it)->getRealTime() <= realtime) {
             // halves the peak performance, use with caution
             if (dgramQlenStatistics) {