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 3A0C413877A for ; Tue, 2 Sep 2014 02:43:54 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D7958E0C50; Tue, 2 Sep 2014 02:43:50 +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 806A2E0C4E for ; Tue, 2 Sep 2014 02:43:49 +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 2AB0133F8DC for ; Tue, 2 Sep 2014 02:43:48 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 048A147C8 for ; Tue, 2 Sep 2014 02:43:44 +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: <1409624024.3bf097a6216e36e4d4a003734f8667e315867b32.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: 3bf097a6216e36e4d4a003734f8667e315867b32 X-VCS-Branch: pending Date: Tue, 2 Sep 2014 02:43:44 +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: 2a7718c0-a7f3-4036-9cd7-fc84d9aeeb1a X-Archives-Hash: f2507b4e94198787a3484b5795bf7406 commit: 3bf097a6216e36e4d4a003734f8667e315867b32 Author: Brian Dolbec gentoo org> AuthorDate: Wed Jan 23 04:57:05 2013 +0000 Commit: Brian Dolbec gmail com> CommitDate: Tue Sep 2 02:13:44 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=3bf097a6 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('"')