Merge "trace-processor: Add extensions once"
diff --git a/src/trace_processor/util/descriptors.cc b/src/trace_processor/util/descriptors.cc
index 61a7fe1..6e9925c 100644
--- a/src/trace_processor/util/descriptors.cc
+++ b/src/trace_processor/util/descriptors.cc
@@ -163,14 +163,11 @@
     }
   }
 
-  // Second pass: extract all the extension protos and add them to the real
-  // protos.
-  for (auto it = proto.file(); it; ++it) {
-    for (auto extension : extensions) {
-      auto status = AddExtensionField(extension.first, extension.second);
-      if (!status.ok())
-        return status;
-    }
+  // Second pass: Add extension fields to the real protos.
+  for (auto extension : extensions) {
+    auto status = AddExtensionField(extension.first, extension.second);
+    if (!status.ok())
+      return status;
   }
 
   // Third pass: resolve the types of all the fields to the correct indiices.