public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Martin Liška" <mliska@suse.cz>
To: Martin Jambor <mjambor@suse.cz>, GCC Patches <gcc-patches@gcc.gnu.org>
Cc: Jan Hubicka <jh@suse.cz>, Jan Hubicka <hubicka@ucw.cz>
Subject: Re: [PATCH] ipa: Sort ipa_param_body_adjustments::m_replacements (PR 108110)
Date: Fri, 6 Jan 2023 12:51:27 +0100	[thread overview]
Message-ID: <252552ce-961e-b10a-976b-4b598b907f7e@suse.cz> (raw)
In-Reply-To: <ri6fscpkjy7.fsf@suse.cz>

Hi Martin

> +  key.unit_offset = unit_offset;
> +  ipa_param_body_replacement *res
> +    = std::lower_bound (m_replacements.begin (), m_replacements.end (), key,
> +			[] (const ipa_param_body_replacement &elt,
> +			    const ipa_param_body_replacement &val)
> +			{
> +			  if (DECL_UID (elt.base) < DECL_UID (val.base))
> +			    return true;
> +			  if (DECL_UID (elt.base) > DECL_UID (val.base))
> +			    return false;
> +			  if (elt.unit_offset < val.unit_offset)
> +			    return true;
> +			  return false;
> +			});

I'm curious if we can re-use compare_param_body_replacement as the introduced
lambda does a very similar thing, right?

Thanks,
Martin

  reply	other threads:[~2023-01-06 11:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-05 16:46 Martin Jambor
2023-01-06 11:51 ` Martin Liška [this message]
2023-01-06 16:50   ` Martin Jambor
2023-01-09 15:19     ` Martin Liška

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=252552ce-961e-b10a-976b-4b598b907f7e@suse.cz \
    --to=mliska@suse.cz \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    --cc=jh@suse.cz \
    --cc=mjambor@suse.cz \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).