[pushed] gdb: trivial cleanups in minimal_symbol_is_less_than

Message ID 20251216185920.290271-1-simon.marchi@polymtl.ca
State New
Headers
Series [pushed] gdb: trivial cleanups in minimal_symbol_is_less_than |

Commit Message

Simon Marchi Dec. 16, 2025, 6:59 p.m. UTC
  From: Simon Marchi <simon.marchi@polymtl.ca>

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 | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)


base-commit: 1f9e31594acb8b04c68383dcc0f3ff843367f318
  

Patch

diff --git a/gdb/minsyms.c b/gdb/minsyms.c
index 0ee9e236232f..70f5f61748a6 100644
--- a/gdb/minsyms.c
+++ b/gdb/minsyms.c
@@ -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 */
     {