Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 16929 invoked from network); 27 Apr 2007 05:53:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Apr 2007 05:53:38 -0000 Received: (qmail 96484 invoked by uid 500); 27 Apr 2007 05:53:43 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 96433 invoked by uid 500); 27 Apr 2007 05:53:43 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 96422 invoked by uid 99); 27 Apr 2007 05:53:43 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Apr 2007 22:53:43 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of lucian.grijincu@gmail.com designates 64.233.162.224 as permitted sender) Received: from [64.233.162.224] (HELO nz-out-0506.google.com) (64.233.162.224) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Apr 2007 22:53:36 -0700 Received: by nz-out-0506.google.com with SMTP id s1so333048nze for ; Thu, 26 Apr 2007 22:53:15 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Z+LQ8cC93BpBhGNSVCd2pNq+yDdUss78tJumqY/HEQX4dJ/6KhAtTGRpjhePtsPs4vgKWKnOKXwpNiJy0VpPKfgL1bCreIoVs0rSezhBJGC0ufExX7eu6L8gcU645Djh/DAahIr62eAfyZcvC7sG8gcSARKYRJvSDJaR3sT0Jp8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=iE/W4VrLrKOrUyu6msIMG14NM43cPzmvGNvbgB5VP6M9D2zTW6bHabQi1WfBl+3fXz84Cw2+4ePjXFvxtQXfzJJfmU5lk4vwP2npGbwN0d02LRPjymPRvBa+rrq2d8AqRvbD2kgKHRmiPwijbytnzH8iS5Wg3dAbgRWBnAl6D74= Received: by 10.114.137.2 with SMTP id k2mr869002wad.1177653195472; Thu, 26 Apr 2007 22:53:15 -0700 (PDT) Received: by 10.114.102.10 with HTTP; Thu, 26 Apr 2007 22:53:15 -0700 (PDT) Message-ID: Date: Fri, 27 Apr 2007 08:53:15 +0300 From: "Lucian Adrian Grijincu" To: dev@apr.apache.org Subject: Re: [PATCH] vformatter cleanups (related to PR 42250) In-Reply-To: <46311BB5.3010507@haxent.com.br> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <46311BB5.3010507@haxent.com.br> X-Virus-Checked: Checked by ClamAV on apache.org in apr-conv10-faster.patch you added: static const char digits[] = "0123456789"; *--p = digits[magnitude % 10]; Why is this faster than: *--p = (char) '0' + (magnitude % 10); ? For your "faster" version, under the hood, the C compiler adds (magnitude % 10) to the address of digits and then copies the contents of the memory location represented by the sum's result into *--p. My version just adds (magnitude % 10) to '0' and stores the result in *--p. Am I missing something here? -- Lucian Adrian Grijincu On 4/27/07, Davi Arnaut wrote: > Hi, > > A few cleanups for the vformatter code. Each patch has a description. > > -- > Davi Arnaut > >