XML writer: make sort_types return values
There are currently 3 overloads of sort_values, all of which modify a
given, presumed empty, vector but which take different argument types:
- type_ptr_set_type
- istring_type_base_wptr_map_type - not used
- vector<function_type_sptr>
We can relying on the return value optimisation which makes for more
readable code. The vectors no longer need to be assumed empty and
space can reserved to match the input.
* src/abg-writer.cc (sort_types): Drop the unused
istring_type_base_wptr_map_type overload. Change the remaining
overloads to reserve the exact number of elements and return
the sorted vector by value. Use std:: prefix for vector and
sort.
(write_referenced_types): Update call to sort_types. Use std::
prefix for vector.
(write_translation_unit): Likewise. Also iterate over types
using a range-based for loop.
Change-Id: Ie7c19205ee43da897cb0bd26054709decc29c38d
Signed-off-by: Giuliano Procida <gprocida@google.com>
1 file changed