This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] validate_failures.py: Fix performance regression


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
><rep.dot.nop@gmail.com> 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,


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]