From: Simon Marchi Date: Wed, 7 Feb 2024 16:53:23 +0000 (-0500) Subject: gdb: remove unnecessary nullptr check in remove_user_added_objfile X-Git-Tag: gdb-15-branchpoint~1004 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=590a4cb21e8e2883fcc8796eab20a110e77f9e2f;p=thirdparty%2Fbinutils-gdb.git gdb: remove unnecessary nullptr check in remove_user_added_objfile Since commit 74daa597e74 ("gdb: add all_objfiles_removed observer"), the objfile passed to the free_objfile observable can't be nullptr. Change-Id: If215aa051ab43c068b11746938022c7efca09caa Approved-By: Andrew Burgess --- diff --git a/gdb/solib.c b/gdb/solib.c index 991ff156d12..952897c37fc 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -1695,7 +1695,7 @@ gdb_bfd_lookup_symbol (bfd *abfd, static void remove_user_added_objfile (struct objfile *objfile) { - if (objfile != 0 && objfile->flags & OBJF_USERLOADED) + if (objfile->flags & OBJF_USERLOADED) { for (solib &so : objfile->pspace->solibs ()) if (so.objfile == objfile)