From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id F034B138A87 for ; Thu, 26 Feb 2015 04:12:15 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 45CE7E0A64; Thu, 26 Feb 2015 04:12:09 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 2C595E0A5A for ; Thu, 26 Feb 2015 04:12:08 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 763FB340C04 for ; Thu, 26 Feb 2015 04:12:06 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A96D912920 for ; Thu, 26 Feb 2015 04:12:03 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1420091886.9944ba53ababcf245d75f5d9c9efce07a4753033.dolsen@gentoo> Subject: [gentoo-commits] proj/catalyst:master commit in: catalyst/ X-VCS-Repository: proj/catalyst X-VCS-Files: catalyst/config.py X-VCS-Directories: catalyst/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 9944ba53ababcf245d75f5d9c9efce07a4753033 X-VCS-Branch: master Date: Thu, 26 Feb 2015 04:12:03 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: adb22d4e-f22b-4f81-ba6e-ee36ea1a339a X-Archives-Hash: 924af3fe9660addf2d1b38df5f259253 commit: 9944ba53ababcf245d75f5d9c9efce07a4753033 Author: Brian Dolbec gentoo org> AuthorDate: Wed Jan 23 04:57:05 2013 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Thu Jan 1 05:58:06 2015 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=9944ba53 reduce 2 operations into one simpler one --- catalyst/config.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/catalyst/config.py b/catalyst/config.py index 460bbd5..8b23342 100644 --- a/catalyst/config.py +++ b/catalyst/config.py @@ -54,11 +54,7 @@ class ParserBase: # Skip any blank lines if not myline: continue - # Look for separator - msearch = myline.find(self.key_value_separator) - - # If separator found assume its a new key - if msearch != -1: + if self.key_value_separator in myline: # Split on the first occurence of the separator creating two strings in the array mobjs mobjs = myline.split(self.key_value_separator, 1) mobjs[1] = mobjs[1].strip().strip('"') From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 7A0321389E2 for ; Thu, 1 Jan 2015 05:59:11 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D0AD1E0897; Thu, 1 Jan 2015 05:59:08 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B9A93E0888 for ; Thu, 1 Jan 2015 05:59:07 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id DDC363406B8 for ; Thu, 1 Jan 2015 05:59:06 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 22819E9EF for ; Thu, 1 Jan 2015 05:59:04 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1420091886.9944ba53ababcf245d75f5d9c9efce07a4753033.dolsen@gentoo> Subject: [gentoo-commits] proj/catalyst:pending commit in: catalyst/ X-VCS-Repository: proj/catalyst X-VCS-Files: catalyst/config.py X-VCS-Directories: catalyst/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 9944ba53ababcf245d75f5d9c9efce07a4753033 X-VCS-Branch: pending Date: Thu, 1 Jan 2015 05:59:04 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 711a6f06-7910-49bf-99da-93f0b644c713 X-Archives-Hash: 01537f28f4cae59fabb0779b0434f747 Message-ID: <20150101055904.ko96qfa7g8Ivkkx9HmXJOGTR7sG6S8tXHHp7dTok-s4@z> commit: 9944ba53ababcf245d75f5d9c9efce07a4753033 Author: Brian Dolbec gentoo org> AuthorDate: Wed Jan 23 04:57:05 2013 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Thu Jan 1 05:58:06 2015 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=9944ba53 reduce 2 operations into one simpler one --- catalyst/config.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/catalyst/config.py b/catalyst/config.py index 460bbd5..8b23342 100644 --- a/catalyst/config.py +++ b/catalyst/config.py @@ -54,11 +54,7 @@ class ParserBase: # Skip any blank lines if not myline: continue - # Look for separator - msearch = myline.find(self.key_value_separator) - - # If separator found assume its a new key - if msearch != -1: + if self.key_value_separator in myline: # Split on the first occurence of the separator creating two strings in the array mobjs mobjs = myline.split(self.key_value_separator, 1) mobjs[1] = mobjs[1].strip().strip('"')