This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 15/22] Use std::string in macho_symfile_read_all_oso
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tom at tromey dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 10 Oct 2016 23:46:28 +0100
- Subject: Re: [RFA 15/22] Use std::string in macho_symfile_read_all_oso
- Authentication-results: sourceware.org; auth=none
- References: <1474949330-4307-1-git-send-email-tom@tromey.com> <1474949330-4307-16-git-send-email-tom@tromey.com> <a599b8ee-9b1a-b9bd-cefb-c4c7ba3f7d20@redhat.com> <878ttvq14z.fsf@tromey.com>
On 10/10/2016 11:39 PM, Tom Tromey wrote:
>>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
>
>>> + if (strncmp (oso2->name, archive_name.c_str (), pfx_len) != 0)
>
> Pedro> Since archive_name is now a std::string, we can use ==/!= for string
> Pedro> comparison:
> Pedro> if (archive_name != oso2->name)
>
> It isn't entirely clear to me that this is valid, given that the current
> comparison is using strncmp.
Wow, I completely missed that, somehow. Sorry about that. I guess you
could use std::string::compare, but then it doesn't really make a difference.
Patch LGTM as is then.
Thanks,
Pedro Alves