]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: trivial cleanups in minimal_symbol_is_less_than
authorSimon Marchi <simon.marchi@polymtl.ca>
Tue, 1 Apr 2025 02:58:47 +0000 (22:58 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Tue, 16 Dec 2025 18:56:18 +0000 (13:56 -0500)
Remove unnecessary braces.

Replace `&` + `->` with `.`.

Remove the trivial comments that just explain how the comparison
operators work in C.

Change-Id: Id77ae534c90219e2c02332ff5606c54d00286eca

gdb/minsyms.c

index 0ee9e236232f2edd4a6e673c2975abf3dc72785d..70f5f61748a6d2bc2946a3a85e4c0932ca38fa77 100644 (file)
@@ -1248,14 +1248,10 @@ static inline bool
 minimal_symbol_is_less_than (const minimal_symbol &fn1,
                             const minimal_symbol &fn2)
 {
-  if ((&fn1)->unrelocated_address () < (&fn2)->unrelocated_address ())
-    {
-      return true;             /* addr 1 is less than addr 2.  */
-    }
-  else if ((&fn1)->unrelocated_address () > (&fn2)->unrelocated_address ())
-    {
-      return false;            /* addr 1 is greater than addr 2.  */
-    }
+  if (fn1.unrelocated_address () < fn2.unrelocated_address ())
+    return true;
+  else if (fn1.unrelocated_address () > fn2.unrelocated_address ())
+    return false;
   else
     /* addrs are equal: sort by name */
     {