This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA 2/5] Use std::string in cp-namespace.c


>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:

Pedro> On 09/22/2016 06:50 PM, Tom Tromey wrote:
>> -		  name_copy[prefix_len] = '\0';
>> +		  name_copy.erase (prefix_len, name_copy.size ());

Pedro> Passing name_copy.size () here looks odd, since that parameter is
Pedro> how many bytes to erase.  Just don't pass a second parameter,
Pedro> which defaults to std::string::npos?

For some reason I was under the impression that the 1-arg form just
removed a single character, but I see that's incorrect.  Thanks.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]