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: [PATCH] Use std::vector for symtab_fns


On 2017-10-11 09:05, Pedro Alves wrote:
On 10/10/2017 09:01 PM, Simon Marchi wrote:
Simple replacement of VEC with std::vector.

gdb/ChangeLog:

	* symfile.c (registered_sym_fns): Make struct, not typedef.
	(DEF_VEC_O (registered_sym_fns)): Remove.
	(symtab_fns): Change type to std::vector.
	(add_symtab_fns): Adjust.
	(find_sym_fns): Adjust.


OK.

- for (i = 0; VEC_iterate (registered_sym_fns, symtab_fns, i, rsf); ++i)
-    if (our_flavour == rsf->sym_flavour)
-      return rsf->sym_fns;
+  for (registered_sym_fns &rsf : symtab_fns)

Small nit: could this be a const ref?  I think it's a good
rule to prefer const over non-const references if we can.

Yes of course, that's an oversight on my part.

Pushed with that fixed, thanks.

Simon


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