Blame SOURCES/rhbz1073640.3.patch

f43afa
From a41f2ad77a642e70f46caa8261746c651f5dc2ad Mon Sep 17 00:00:00 2001
f43afa
From: Josh Stone <jistone@redhat.com>
f43afa
Date: Mon, 2 Dec 2013 14:34:07 -0800
f43afa
Subject: [PATCH] Use proper set operations for symtab dupe checks
f43afa
f43afa
In query_symtab_func_info, rather than full set iteration to check an
f43afa
address in alias_dupes, just use set::insert().second as a test.  This
f43afa
is what sets are designed to be algorithmically good at.
f43afa
f43afa
This also has the benefit of adding to alias_dupes, so duplicates within
f43afa
the symbol table itself will still only be probed once.  (If we didn't
f43afa
want that effect, we would just use set::count() to test membership.)
f43afa
---
f43afa
 tapsets.cxx | 22 ++++------------------
f43afa
 1 file changed, 4 insertions(+), 18 deletions(-)
f43afa
f43afa
diff --git a/tapsets.cxx b/tapsets.cxx
f43afa
index f1a5843..b3cfa0e 100644
f43afa
--- a/tapsets.cxx
f43afa
+++ b/tapsets.cxx
f43afa
@@ -1003,24 +1003,10 @@ query_symtab_func_info (func_info & fi, dwarf_query * q)
f43afa
 
f43afa
   // If there are already probes in this module, lets not duplicate.
f43afa
   // This can come from other weak symbols/aliases or existing
f43afa
-  // matches from Dwarf DIE functions.
f43afa
-  if (q->alias_dupes.size() > 0)
f43afa
-    {
f43afa
-      for (set<Dwarf_Addr>::iterator it=q->alias_dupes.begin(); it!=q->alias_dupes.end(); ++it)
f43afa
-	{
f43afa
-	  // If we've already got a probe at that pc, skip it
f43afa
-	  if (*it == addr)
f43afa
-	    return;
f43afa
-	  if (*it != addr && ++it==q->alias_dupes.end())
f43afa
-	    {
f43afa
-	      // Build a probe at this point
f43afa
-	      query_func_info(addr, fi, q);
f43afa
-	      return;
f43afa
-	    }
f43afa
-	}
f43afa
-    }
f43afa
-  else
f43afa
-    query_func_info(addr,fi,q);
f43afa
+  // matches from Dwarf DIE functions.  Try to add this addr to the
f43afa
+  // collection, and only continue if it was new.
f43afa
+  if (q->alias_dupes.insert(addr).second)
f43afa
+    query_func_info(addr, fi, q);
f43afa
 }
f43afa
 
f43afa
 void
f43afa
-- 
f43afa
1.8.3.1
f43afa