[review] Store objfiles on a std::list

Christian Biesinger (Code Review) gerrit@gnutoolchain-gerrit.osci.io
Tue Nov 5 00:38:00 GMT 2019


Christian Biesinger has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/499
......................................................................


Patch Set 1:

(1 comment)

https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/499/1/gdb/progspace.h 
File gdb/progspace.h:

https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/499/1/gdb/progspace.h@179 
PS1, Line 179: 
137 | struct program_space
    | ...
174 | 
175 |   /* Return true if there is more than one object file loaded; false
176 |      otherwise.  */
177 |   bool multi_objfile_p () const
178 |   {
179 >     return objfiles_list.size () > 1;
180 |   }
181 | 
182 | 
183 |   /* Pointer to next in linked list.  */
184 |   struct program_space *next = NULL;

> This spot has to return false if there are 0 or 1 objfiles, […]

Sorry, you are of course correct. And as of C++11 size() is guaranteed to be a constant time call, so that's ok.



-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: Ib4430e3db6f9a390399924379a5c10426c514853
Gerrit-Change-Number: 499
Gerrit-PatchSet: 1
Gerrit-Owner: Tom Tromey <tromey@sourceware.org>
Gerrit-Reviewer: Tom Tromey <tromey@sourceware.org>
Gerrit-CC: Christian Biesinger <cbiesinger@google.com>
Gerrit-Comment-Date: Tue, 05 Nov 2019 00:37:55 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Christian Biesinger <cbiesinger@google.com>
Comment-In-Reply-To: Tom Tromey <tromey@sourceware.org>
Gerrit-MessageType: comment



More information about the Gdb-patches mailing list