[pushed] gdb: trivial cleanups in minimal_symbol_is_less_than
Commit Message
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
@@ -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 */
{