From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16231 invoked by alias); 6 Feb 2013 16:56:05 -0000 Received: (qmail 16023 invoked by uid 22791); 6 Feb 2013 16:56:01 -0000 X-SWARE-Spam-Status: No, hits=-4.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-ee0-f48.google.com (HELO mail-ee0-f48.google.com) (74.125.83.48) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 06 Feb 2013 16:55:56 +0000 Received: by mail-ee0-f48.google.com with SMTP id t10so925837eei.21 for ; Wed, 06 Feb 2013 08:55:55 -0800 (PST) X-Received: by 10.14.178.196 with SMTP id f44mr98923247eem.14.1360169755312; Wed, 06 Feb 2013 08:55:55 -0800 (PST) Received: from s42.loc (91-119-139-175.dynamic.xdsl-line.inode.at. [91.119.139.175]) by mx.google.com with ESMTPS id q42sm28479580eem.14.2013.02.06.08.55.53 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 06 Feb 2013 08:55:54 -0800 (PST) Received: from cow by s42.loc with local (Exim 4.80) (envelope-from ) id 1U38Hn-0003lB-Ki; Wed, 06 Feb 2013 17:55:51 +0100 Date: Wed, 06 Feb 2013 16:56:00 -0000 From: Bernhard Reutner-Fischer To: Diego Novillo Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] validate_failures.py: Fix performance regression Message-ID: <20130206165551.GA14341@mx.loc> References: <20121205073542.GA23452@mx.loc> <1354817522-18274-1-git-send-email-rep.dot.nop@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2013-02/txt/msg00248.txt.bz2 On Fri, Dec 07, 2012 at 10:31:57AM -0500, Diego Novillo wrote: >On Thu, Dec 6, 2012 at 1:12 PM, Bernhard Reutner-Fischer > wrote: > >> def IsComment(line): >> """Return True if line is a comment.""" >> - return line.startswith('#') >> + return bool(re.matches("#", line)) > >startswith() is a better match here. > >> def IsInclude(line): >> """Return True if line is an include of another file.""" >> - return line.startswith("@include ") >> + return bool(re.matches("@include ", line)) > >Likewise. > >> def IsNegativeResult(line): >> """Return True if line should be removed from the expected results.""" >> - return line.startswith("@remove ") >> + return bool(re.matches("@remove ", line)) > >Likewise. > > >OK with those changes. Applied as r195811 thanks,