Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:73058 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52682 invoked from network); 11 Mar 2014 09:53:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Mar 2014 09:53:55 -0000 Authentication-Results: pb1.pair.com smtp.mail=tjerk.meesters@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tjerk.meesters@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.180 as permitted sender) X-PHP-List-Original-Sender: tjerk.meesters@gmail.com X-Host-Fingerprint: 209.85.220.180 mail-vc0-f180.google.com Received: from [209.85.220.180] ([209.85.220.180:50233] helo=mail-vc0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E6/C2-29501-23DDE135 for ; Tue, 11 Mar 2014 04:53:55 -0500 Received: by mail-vc0-f180.google.com with SMTP id lf12so2475618vcb.25 for ; Tue, 11 Mar 2014 02:53:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=mknpPO5wBTMf/mBS+eJhp8+noIlbS5eqBN1CfLrPs1Y=; b=pKaLX4UjQO5PV2BnZIVbWbOW4/aPaVJuximb5hIzldzLfUFms4aGlS2HUF7PHVrWOM cdJ4OCWZWvyk6CJXmriti1lYovx+LZ4zBb1OG6FaNk4Tj0+QpQXVyxQIAgWGjhz1/pE/ oI/qM2arJ/jz0uQLG2gv3YifKL0/at5WbO+PxOOZkU58ENuX6pg7pbzDbhWiKjttACFX +2nrg2guVbUPsdL9sCJX7GXhs2LghJkfYvSAFPUJvHzbGSmNL/tTRlIEJLK8T/2wnl2C 8hhvhMpYuEDZrHYxn8iVu3PLlEe6jmseoN1U/maCGQvYRYP1rEJOlBTbWOBh/TDqdwav P27g== MIME-Version: 1.0 X-Received: by 10.52.165.105 with SMTP id yx9mr9815933vdb.22.1394531632210; Tue, 11 Mar 2014 02:53:52 -0700 (PDT) Received: by 10.58.55.131 with HTTP; Tue, 11 Mar 2014 02:53:52 -0700 (PDT) In-Reply-To: References: Date: Tue, 11 Mar 2014 17:53:52 +0800 Message-ID: To: Kris Craig Cc: Tig , PHP Internals Content-Type: multipart/alternative; boundary=001a11c210cc90e6ff04f451b291 Subject: Re: [PHP-DEV] Possible tweak for tm2unixtime.c From: tjerk.meesters@gmail.com (Tjerk Meesters) --001a11c210cc90e6ff04f451b291 Content-Type: text/plain; charset=ISO-8859-1 Hi On Tue, Mar 11, 2014 at 5:42 PM, Kris Craig wrote: > > > > On Tue, Mar 11, 2014 at 2:11 AM, Tjerk Meesters wrote: > >> On Tue, Mar 11, 2014 at 2:14 PM, Tig wrote: >> >> > Hello. I'm not sure, but I believe the following `do {} while` code is >> > pointless in /ext/date/lib/tm2unixtime.c (located here: >> > >> > >> https://github.com/php/php-src/blob/af6c11c5f060870d052a2b765dc634d9e47d0f18/ext/date/lib/tm2unixtime.c >> > ) >> > >> > The code in question (appears a lot): >> > >> > do {} while (do_range_limit(0, 60, 60, &rt->s, &rt->i)); >> > >> > The method `do_range_limit()` will always return 0, so why not just >> > call it like so: >> > >> > do_range_limit(0, 60, 60, &rt->s, &rt->i); >> > >> > And remove the `do {} while` loop. >> > >> >> I can only tell you that removing them will cause 14 test cases to fail. >> Unfortunately I can't tell you why that happens. >> >> >> > >> > There may be a reason why that loop code is there, but I'm not seeing >> > why. More than happy to be wrong. >> > >> > -Tig >> > >> > -- >> > PHP Internals - PHP Runtime Development Mailing List >> > To unsubscribe, visit: http://www.php.net/unsub.php >> > >> > >> >> >> -- >> -- >> Tjerk >> > > Do you recall which tests are those affected? > Never mind, I'm an idiot :) The following will work just peachy: https://github.com/datibbaw/php-src/compare/master...date-empty-loops > > --Kris > > -- -- Tjerk --001a11c210cc90e6ff04f451b291--