diff options
author | Christian Biesinger <cbiesinger@google.com> | 2019-09-28 19:45:20 -0500 |
---|---|---|
committer | Christian Biesinger <cbiesinger@google.com> | 2019-09-30 13:32:32 -0500 |
commit | 6fb08628e0f894f01e3e4834d5262629ca8f1920 (patch) | |
tree | 46ad9142a7a707cdc0af2365255e07a9aa8e955a /bfd/cpu-riscv.c | |
parent | 4a56a5200793f7476991952afa61be11a6d2ed41 (diff) | |
download | gdb-6fb08628e0f894f01e3e4834d5262629ca8f1920.zip gdb-6fb08628e0f894f01e3e4834d5262629ca8f1920.tar.gz gdb-6fb08628e0f894f01e3e4834d5262629ca8f1920.tar.bz2 |
Use std::sort instead of qsort in minsyms.c
This has better typesafety and is also marginally faster (either
due to inlining or because it avoids indirection through a
function pointer).
Note that in this change:
- return 1; /* fn1 has no name, so it is "less". */
+ return true; /* fn1 has no name, so it is "less". */
else if (name1) /* fn2 has no name, so it is "less". */
- return -1;
+ return false;
I am fairly sure the old code was wrong (ie. code didn't match the
comment and the comment seemed correct), so I fixed it.
gdb/ChangeLog:
2019-09-28 Christian Biesinger <cbiesinger@google.com>
* minsyms.c (compare_minimal_symbols): Rename to...
(minimal_symbol_is_less_than): ...this, and adjust to STL
conventions (return bool, take arguments as references)
(minimal_symbol_reader::install): Call std::sort instead
of qsort.
Diffstat (limited to 'bfd/cpu-riscv.c')
0 files changed, 0 insertions, 0 deletions