Re: [PATCH 11/22] Use std::vector for cli_ui_out_data::streams

Pedro Alves
2016-11-24T18:41:01Z

On 11/24/2016 03:26 PM, Simon Marchi wrote:
> @@ -406,13 +404,14 @@ cli_out_set_stream (struct ui_out *uiout, struct ui_file *stream)
> {
> cli_out_data *data = (cli_out_data *) ui_out_data (uiout);
> struct ui_file *old;
> -
> - old = VEC_pop (ui_filep, data->streams);
> - VEC_quick_push (ui_filep, data->streams, stream);
> +
> + old = data->streams.back ();
> + data->streams.pop_back ();
> + data->streams.push_back (stream);

back() returns a reference, so this pop/push can be just:

data->streams.back () = stream;

Thanks,
Pedro Alves