Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:73056 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48937 invoked from network); 11 Mar 2014 09:11:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Mar 2014 09:11:30 -0000 Authentication-Results: pb1.pair.com header.from=tjerk.meesters@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=tjerk.meesters@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.128.173 as permitted sender) X-PHP-List-Original-Sender: tjerk.meesters@gmail.com X-Host-Fingerprint: 209.85.128.173 mail-ve0-f173.google.com Received: from [209.85.128.173] ([209.85.128.173:40170] helo=mail-ve0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5D/02-29501-143DE135 for ; Tue, 11 Mar 2014 04:11:29 -0500 Received: by mail-ve0-f173.google.com with SMTP id oy12so8084794veb.4 for ; Tue, 11 Mar 2014 02:11:27 -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=MX5fmshEUOMasE2/UdcBp3q6VW7mkbHxoKShaAP0jPU=; b=y2ZdqA5Wrin5htlib1iO0bks1AhIR87yYH5NlnIadE4X9C3+6caw/LQJEW+1mUH2y0 bCXI4Va7/hWWMaHmU4NCnxRvmxDFrcLBLXtJU6dwSuIGU65DLEFJICnQ0H7BebWfibeQ wFiYAzpKkfSLJa5/mxUkrPa/fNe+Ei5txDbmIITmf9AVMrLydlCrgBR16zsf2UJ/IC4v JpouRQEhmHdvObPielcS2h3sxzXIOa3cB3ts76DL/jENwo9BmV8sOjV/wm+lExOCi6oJ pRehuZSs5LYcFzxDGgHYZ9mz00lbNI2QrIdHCu+nhnHJ22IHLpgaq794Y9DhsHyE3CU+ Np1A== MIME-Version: 1.0 X-Received: by 10.220.67.18 with SMTP id p18mr26678342vci.14.1394529086980; Tue, 11 Mar 2014 02:11:26 -0700 (PDT) Received: by 10.58.55.131 with HTTP; Tue, 11 Mar 2014 02:11:26 -0700 (PDT) In-Reply-To: References: Date: Tue, 11 Mar 2014 17:11:26 +0800 Message-ID: To: Tig Cc: PHP Internals Content-Type: multipart/alternative; boundary=047d7b343f9adbc73404f4511a7f Subject: Re: [PHP-DEV] Possible tweak for tm2unixtime.c From: tjerk.meesters@gmail.com (Tjerk Meesters) --047d7b343f9adbc73404f4511a7f Content-Type: text/plain; charset=ISO-8859-1 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 --047d7b343f9adbc73404f4511a7f--