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 44DA7138E74 for ; Tue, 2 Sep 2014 07:12:38 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3CEA0E0CFA; Tue, 2 Sep 2014 07:12:37 +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 A1C48E0CFF for ; Tue, 2 Sep 2014 07:12:36 +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 7A36E33FEC9 for ; Tue, 2 Sep 2014 07:12:35 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 87BCC47F7 for ; Tue, 2 Sep 2014 07:12:32 +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: <1409639519.ea259de3ccbc5c3cebc9e39b519666dace29511c.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: ea259de3ccbc5c3cebc9e39b519666dace29511c X-VCS-Branch: pending Date: Tue, 2 Sep 2014 07:12:32 +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: 3738d4f0-f988-462f-bb87-f1e0a3b733f6 X-Archives-Hash: ec83b5ce12084311d77438d85977466f commit: ea259de3ccbc5c3cebc9e39b519666dace29511c Author: Brian Dolbec gentoo org> AuthorDate: Wed Jan 23 04:57:05 2013 +0000 Commit: Brian Dolbec gmail com> CommitDate: Tue Sep 2 06:31:59 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=ea259de3 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('"')