From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-b4-smtp.messagingengine.com (fout-b4-smtp.messagingengine.com [202.12.124.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 034D22512E4 for ; Wed, 12 Mar 2025 15:36:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.147 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741793816; cv=none; b=qmzMcHZQXj0nuRsbjXLjj/ZvcUFFVe9Nj1zKJjzysObdSUpzIfUFB3RKB4njAPV61OPHgFvnCKUDEdNxFzz4khf+gm4OjWyH75EeBAEVc8lHnL2Hk5Y81ckrzsRHrSBVFbtcQGIJoN/UYAF/24K35JWxKhyjdJbvs+IvdAx1uJs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741793816; c=relaxed/simple; bh=/ksgFA44HW3OIwuKe1uWW+amSBzNeMDmTax24mySkrw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JcEYR5tv3O6O0oHF4asBhLn4RpbfeIKGUkU/nPtCl0dpQgD0NPPu7qgR+l07XyeutnCj6idyrvhSHEpFT7i5OMEcGeii6lKEigcqSYtoXqlYwrz7EUuW11aHmgJXh11wmHaEkM6XBH53MXs845BdX7M5l0CKpfJmC1s7jU3OY0U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=P7n1OYGH; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=6FfxS5Op; arc=none smtp.client-ip=202.12.124.147 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="P7n1OYGH"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="6FfxS5Op" Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfout.stl.internal (Postfix) with ESMTP id 3A6131140158; Wed, 12 Mar 2025 11:36:54 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-09.internal (MEProxy); Wed, 12 Mar 2025 11:36:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1741793814; x=1741880214; bh=JOm4Ltnb5w 8GLR7L0WVYhqXbnLRxpjQfXMuK6LzHBOY=; b=P7n1OYGHjJ/V5szp199f+7dfAu I1JXqoTkxbSW+YXDrdIl0JPoKH+PHVEfhctxj3wtTItBWgshnIfavBeAsMY74gdH B490RU0oEmLM84BVIQ6dWlhafVtYGz4dcYVfKCroS2lB0OA2sI1RdLKKEEOUScSN jyip6UPxx9KBjFcXbKnqh23tnSbGT4zo2KYo9olrpycyYYMc3+9iOSyhCTWpPFsX 7rQX4dO4I4B/0V11kbxAbutyi4ehHhCR5I2Q9sLHVbfPdEJZrB7euj9MiXeCSt55 eMWQCEU5f65jYqvehyh5bVU+7Ky4t23eEVNRbn6Wx9VDWAlagBgQo5d85Gow== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1741793814; x=1741880214; bh=JOm4Ltnb5w8GLR7L0WVYhqXbnLRxpjQfXMu K6LzHBOY=; b=6FfxS5OpKHXOYAhy4g0tfkIH6pBTegbYjDkrwYwGM3N3G2QVcwj vHNoAIuyAO9dref7Z1gk+0S7m1WqV5+gY4j4fUeuxIqtHevqqJ4R5v/naJJerrvW t+FESIt5gA8nwhMqEw4sf6esiHZ8UpvtpOzC5oCaQ4ZFEkXubFvV//Zjwaqqy1XB 6fZraQpX/cW5oTGtiR1+DQShJny+siy+KRdvdjbjOR+Vk5FrP1XUhrgShJvOlytM hCgxrpUlzUXmtaet3QeGvCHHNDJf647lbPDMooT6dPqYG1AKZ7AHuX7vJwK4R363 bqq8vRmyazJT1Z9VaUliK46IMhaGycAUyzg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduvdehgeehucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepfffhvfevuffkfhggtggujgesthdtredttddt vdenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrd himheqnecuggftrfgrthhtvghrnhepveekkeffhfeitdeludeigfejtdetvdelvdduhefg ueegudfghfeukefhjedvkedtnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpe hmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepjedpmhhouggv pehsmhhtphhouhhtpdhrtghpthhtohepghhithesvhhgvghrrdhkvghrnhgvlhdrohhrgh dprhgtphhtthhopehkrghrthhhihhkrddukeeksehgmhgrihhlrdgtohhmpdhrtghpthht ohepphgvfhhfsehpvghffhdrnhgvthdprhgtphhtthhopehgihhtshhtvghrsehpohgsoh igrdgtohhmpdhrtghpthhtohepshhhvghjihgrlhhuohesghhmrghilhdrtghomhdprhgt phhtthhopehsrghnuggrlhhssegtrhhushhthihtohhothhhphgrshhtvgdrnhgvthdprh gtphhtthhopegthhhrihhstghoohhlsehtuhigfhgrmhhilhihrdhorhhg X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 12 Mar 2025 11:36:52 -0400 (EDT) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 1ad80849 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 12 Mar 2025 15:36:51 +0000 (UTC) Date: Wed, 12 Mar 2025 16:36:50 +0100 From: Patrick Steinhardt To: shejialuo Cc: git@vger.kernel.org, Karthik Nayak , "brian m. carlson" , Jeff King , Junio C Hamano , Christian Couder Subject: Re: [PATCH v5 09/16] refs/iterator: separate lifecycle from iteration Message-ID: References: <20250306-pks-update-ref-optimization-v5-0-dcb2ee037e97@pks.im> <20250306-pks-update-ref-optimization-v5-9-dcb2ee037e97@pks.im> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Wed, Mar 12, 2025 at 09:45:48PM +0800, shejialuo wrote: > On Thu, Mar 06, 2025 at 04:08:40PM +0100, Patrick Steinhardt wrote: > > > @@ -350,19 +338,10 @@ static int prefix_ref_iterator_advance(struct ref_iterator *ref_iterator) > > > > while ((ok = ref_iterator_advance(iter->iter0)) == ITER_OK) { > > int cmp = compare_prefix(iter->iter0->refname, iter->prefix); > > - > > if (cmp < 0) > > continue; > > - > > - if (cmp > 0) { > > - /* > > - * As the source iterator is ordered, we > > - * can stop the iteration as soon as we see a > > - * refname that comes after the prefix: > > - */ > > - ok = ref_iterator_abort(iter->iter0); > > - break; > > - } > > + if (cmp > 0) > > + return ITER_DONE; > > Should we maintain the above comment? Why do we delete the comment. I > somehow think the comment makes sense. Yeah, let's. I'll add it back in. Patrick