From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa.local.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.1 To: devel@lists.altlinux.org References: <20191210152343.33867-1-darktemplar@altlinux.org> <20191210152343.33867-2-darktemplar@altlinux.org> <1020fee7-831e-5a20-d28c-ee3398688ded@altlinux.org> From: Aleksei Nikiforov Message-ID: <9f153cfb-830d-582f-9aa1-4f47f8043858@altlinux.org> Date: Wed, 11 Dec 2019 11:11:55 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <1020fee7-831e-5a20-d28c-ee3398688ded@altlinux.org> Content-Type: text/plain; charset=koi8-r; format=flowed Content-Language: ru Content-Transfer-Encoding: 8bit Subject: Re: [devel] [PATCH for apt 01/38] Replace post-increments with pre-increments X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: ALT Linux Team development discussions List-Id: ALT Linux Team development discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 08:12:00 -0000 Archived-At: List-Archive: List-Post: 11.12.2019 10:51, Aleksei Nikiforov ΠΙΫΕΤ: > 10.12.2019 21:21, Alexey Tourbin ΠΙΫΕΤ: >> On Tue, Dec 10, 2019 at 6:25 PM Aleksei Nikiforov >> wrote: >>> +++ b/apt/apt-pkg/acquire-item.cc >>> @@ -486,7 +486,7 @@ void pkgAcqIndexRel::Done(const string >>> &Message,unsigned long long Size,const st >>> >>> ššššššššš bool found = false; >>> ššššššššš for (vector::const_iterator I = >>> Repository->FingerPrint.begin(); >>> -šššššššššššš I != Repository->FingerPrint.end(); I++) >>> +šššššššššššš I != Repository->FingerPrint.end(); ++I) >>> ššššššššš { >>> šššššššššššš // Match fingerprint of Release file >>> šššššššššššš if ((*I) == FingerPrint) >> >> How does that fix anything? It doesn't! Avoid unnecessary changes, >> only make those beaming with thought.š As Pouchkine wrote, "strashisya >> uchasti bessmyslennykh pevtsov". > > You're right, but not the way you think you are :) > > In order for this fix to matter, signature of operator++ should be fixed > as well. Currently it's not a standard, and returns not an object copy > or reference to object, but returns void. I'll fix it too and this > change would matter :) > I've re-read contents of this patch, and it includes only operator changes for standard iterators, so everything is fine with this patch. Although, unstandard operators from Apt code may be improved as I wrote in my last message. As for your original question, switching post-increments to pre-increments for non-fundamental types (i.e. objects like iterators) either improves compile-time performance or improves run-time performance. >> _______________________________________________ >> Devel mailing list >> Devel@lists.altlinux.org >> https://lists.altlinux.org/mailman/listinfo/devel >> > _______________________________________________ > Devel mailing list > Devel@lists.altlinux.org > https://lists.altlinux.org/mailman/listinfo/devel