Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Simon Marchi <simon.marchi@polymtl.ca>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Use an std::vector for inline_states
Date: Sun, 08 Apr 2018 17:29:00 -0000	[thread overview]
Message-ID: <3d8cc397-b7d5-b705-bf5f-8eff154eb587@redhat.com> (raw)
In-Reply-To: <da7e881e-9178-fa33-16f3-0e0cf7da76d2@polymtl.ca>

On 04/08/2018 12:21 AM, Simon Marchi wrote:

> 
>  /* Forget about any hidden inlined functions in PTID, which is new or
> @@ -112,36 +102,34 @@ allocate_inline_frame_state (ptid_t ptid)
>  void
>  clear_inline_frame_state (ptid_t ptid)
>  {

...

> -  for (ix = 0; VEC_iterate (inline_state_s, inline_states, ix, state); ix++)
> -    if (ptid_equal (state->ptid, ptid))
> -      {
> -	VEC_unordered_remove (inline_state_s, inline_states, ix);
> -	return;
> -      }
> +  auto it = std::find_if (inline_states.begin (), inline_states.end (),
> +			  [&ptid] (const inline_state &state)
> +			    {
> +			      return ptid == state.ptid;
> +			    });
> +
> +  if (it != inline_states.end ())
> +    inline_states.erase (it);

Should this erase be unordered_remove as well?

Otherwise LGTM.

Thanks,
Pedro Alves


  reply	other threads:[~2018-04-08 17:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-07 14:42 Simon Marchi
2018-04-07 19:28 ` Pedro Alves
2018-04-07 21:13   ` Simon Marchi
2018-04-07 23:21   ` Simon Marchi
2018-04-08 17:29     ` Pedro Alves [this message]
2018-04-09  9:10       ` Pedro Alves
2018-04-09 19:45         ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3d8cc397-b7d5-b705-bf5f-8eff154eb587@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@polymtl.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox