Re: [PATCH 5/9] Change decode_compound_collector to use std::vector

Simon Marchi
2018-08-20T01:20:10Z

On 2018-08-17 14:04, Keith Seitz wrote:
> @@ -3514,12 +3511,10 @@ public:
> htab_delete (m_unique_syms);
> }
>
> - /* Releases ownership of the collected symbols and returns them. */
> - VEC (symbolp) *release_symbols ()
> + /* Return all symbols collected. */
> + std::vector<symbol *> release_symbols ()
> {
> - VEC (symbolp) *res = m_symbols;
> - m_symbols = NULL;
> - return res;
> + return std::move (m_symbols);

I've always read that it was bad to use std::move on a return value:

https://diego.assencio.com/?index=f57f25fd5a187c70fc7f34fcf5374773

though in this case it seems like the right thing to do.

Simon