This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 05/15] Simplify calls to init_psymbol_list
- From: Tom Tromey <tom at tromey dot com>
- To: Simon Marchi <simark at simark dot ca>
- Cc: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Sun, 23 Sep 2018 15:12:17 -0600
- Subject: Re: [RFA 05/15] Simplify calls to init_psymbol_list
- References: <20180510222357.27332-1-tom@tromey.com> <20180510222357.27332-6-tom@tromey.com> <f5d86da7-2a7b-b1f7-4c79-70ff469dc366@simark.ca>
>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:
>> void
>> init_psymbol_list (struct objfile *objfile, int total_symbols)
>> {
>> - /* Free any previously allocated psymbol lists. */
>> - objfile->global_psymbols.clear ();
>> - objfile->static_psymbols.clear ();
>> + if (objfile->global_psymbols.capacity () == 0
>> + && objfile->static_psymbols.capacity () == 0)
>> + return;
Simon> Hmm, isn't the condition backwards?
Yep.
Simon> Would LGTM with the condition fixed (assuming I am not the one being confused)
Simon> or removed.
I've fixed it locally.
Tom