Pass a bunch of parameters by reference as they ought to be
authorDodji Seketeli <dodji@redhat.com>
Sat, 7 Nov 2015 22:04:01 +0000 (23:04 +0100)
committerDodji Seketeli <dodji@redhat.com>
Sat, 7 Nov 2015 22:22:17 +0000 (23:22 +0100)
* include/abg-ir.h (operator==): In the overload for
elf_symbol_sptr, pass the parameters by reference.
* src/abg-ir.cc (operator==): Do the same at definition site.
* src/abg-comparison.cc (maybe_report_diff_for_member): Pass
parameters by reference.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
include/abg-ir.h
src/abg-comparison.cc
src/abg-ir.cc

index 6d42c2c..51e2ca5 100644 (file)
@@ -646,7 +646,7 @@ bool
 string_to_elf_symbol_binding(const string&, elf_symbol::binding&);
 
 bool
-operator==(const elf_symbol_sptr lhs, const elf_symbol_sptr rhs);
+operator==(const elf_symbol_sptr& lhs, const elf_symbol_sptr& rhs);
 
 bool
 elf_symbols_alias(const elf_symbol& s1, const elf_symbol& s2);
index 372a1c4..86f27c8 100644 (file)
@@ -6245,11 +6245,11 @@ get_pretty_representation(diff* d)
 }
 
 static bool
-maybe_report_diff_for_member(decl_base_sptr    decl1,
-                            decl_base_sptr     decl2,
-                            diff_context_sptr  ctxt,
-                            ostream&           out,
-                            const string&      indent);
+maybe_report_diff_for_member(const decl_base_sptr&     decl1,
+                            const decl_base_sptr&      decl2,
+                            const diff_context_sptr&   ctxt,
+                            ostream&                   out,
+                            const string&              indent);
 
 /// Stream a string representation for a member function.
 ///
@@ -6899,11 +6899,11 @@ compute_diff(const var_decl_sptr        first,
 ///
 /// @return true if something was reported, false otherwise.
 static bool
-maybe_report_diff_for_member(decl_base_sptr    decl1,
-                            decl_base_sptr     decl2,
-                            diff_context_sptr  ctxt,
-                            ostream&           out,
-                            const string&      indent)
+maybe_report_diff_for_member(const decl_base_sptr&     decl1,
+                            const decl_base_sptr&      decl2,
+                            const diff_context_sptr&   ctxt,
+                            ostream&                   out,
+                            const string&              indent)
 
 {
   bool reported = false;
index 9799cd5..faebf53 100644 (file)
@@ -1315,7 +1315,7 @@ elf_symbol::does_alias(const elf_symbol& o) const
 }
 
 bool
-operator==(const elf_symbol_sptr lhs, const elf_symbol_sptr rhs)
+operator==(const elf_symbol_sptr& lhs, const elf_symbol_sptr& rhs)
 {
   if (!!lhs != !!rhs)
     return false;