From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id ED9303858D28 for ; Fri, 6 Jan 2023 11:51:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ED9303858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 8830C26905; Fri, 6 Jan 2023 11:51:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1673005887; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DdVQJUtXZRIfRiliRTpOJYifFxfOLVYSrEI6u+jdJaI=; b=HnUAACK+19UOWr2OqSqavj/ZUexMrDLmGaELm0kZvLdmtSH/LdG/kzl0Rh/fIsaSTA3h/W XrI9AZd+awSOs5GTOGWF0EEL81wxD9QCqcWWdGmwZwRHEkTslG6SJLvel9Tebxnvbq0i0Y /HmG33zAMw4NzKknhfmC3PwBKMSTLHQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1673005887; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DdVQJUtXZRIfRiliRTpOJYifFxfOLVYSrEI6u+jdJaI=; b=9OMq+hnDci36pTit5rItl3rVbhHwNZTUusBh3x4yrMXTOCUyavaKOjiBRWCBI5717F7OZI ir0X8P8PY7EacjBQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 6B4B113596; Fri, 6 Jan 2023 11:51:27 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id XkD8GD8LuGNcLgAAMHmgww (envelope-from ); Fri, 06 Jan 2023 11:51:27 +0000 Message-ID: <252552ce-961e-b10a-976b-4b598b907f7e@suse.cz> Date: Fri, 6 Jan 2023 12:51:27 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH] ipa: Sort ipa_param_body_adjustments::m_replacements (PR 108110) Content-Language: en-US To: Martin Jambor , GCC Patches Cc: Jan Hubicka , Jan Hubicka References: From: =?UTF-8?Q?Martin_Li=c5=a1ka?= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE,SPF_SOFTFAIL,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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