summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2021-12-03 16:35:37 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2021-12-07 15:58:54 -0500
commit9931e521bf3a057cc2770eb92906c2ae38335c5a (patch)
tree6f4ab63aca4f8f6a9a011d8f478406d39dc6e1af /gdb/linespec.c
parentgdb: rename "maint agent" functions (diff)
downloadbinutils-gdb-9931e521bf3a057cc2770eb92906c2ae38335c5a.tar.gz
binutils-gdb-9931e521bf3a057cc2770eb92906c2ae38335c5a.tar.bz2
binutils-gdb-9931e521bf3a057cc2770eb92906c2ae38335c5a.zip
gdb/linespec.c: simplify condition
We can remove the empty check: if the vector has size 1, it is obviously not empty. This code ended up like this because the empty check used to be a NULL check. Change-Id: I1571bd0228818ca93f6a6b444e9b010dc2da4c08
Diffstat (limited to 'gdb/linespec.c')
-rw-r--r--gdb/linespec.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 56bfaede9d9..44134665ac7 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -2085,8 +2085,7 @@ canonicalize_linespec (struct linespec_state *state, const linespec *ls)
if (explicit_loc->function_name == NULL)
{
/* No function was specified, so add the symbol name. */
- gdb_assert (!ls->labels.function_symbols->empty ()
- && (ls->labels.function_symbols->size () == 1));
+ gdb_assert (ls->labels.function_symbols->size () == 1);
block_symbol s = ls->labels.function_symbols->front ();
explicit_loc->function_name = xstrdup (s.symbol->natural_name ());
}