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 E1CE11387FD for ; Thu, 11 Sep 2014 03:08:47 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4C19AE09D6; Thu, 11 Sep 2014 03:08:46 +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 1537CE09D0 for ; Thu, 11 Sep 2014 03:08:44 +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 209B6340223 for ; Thu, 11 Sep 2014 03:08:43 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 947AD5316 for ; Thu, 11 Sep 2014 03:08:40 +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: <1410404738.4d0b5107e1706e9db1f35f658ef0a1967711ec8e.dol-sen@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: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 4d0b5107e1706e9db1f35f658ef0a1967711ec8e X-VCS-Branch: pending Date: Thu, 11 Sep 2014 03:08:40 +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: e981bb45-7b6b-4e0d-bc89-5f9773661212 X-Archives-Hash: 79a794500201ac2b4161b0ad5e1160cf commit: 4d0b5107e1706e9db1f35f658ef0a1967711ec8e Author: Brian Dolbec gentoo org> AuthorDate: Wed Jan 23 04:57:05 2013 +0000 Commit: Brian Dolbec gmail com> CommitDate: Thu Sep 11 03:05:38 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=4d0b5107 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('"')