Gentoo Archives: gentoo-catalyst

From: Brian Dolbec <dolsen@g.o>
To: gentoo-catalyst@l.g.o
Subject: [gentoo-catalyst] [PATCH 4/6] reduce 2 operations into one simpler one
Date: Thu, 11 Sep 2014 04:01:22
Message-Id: 1410408068-3441-5-git-send-email-dolsen@gentoo.org
In Reply to: [gentoo-catalyst] [PATCH 0/6] Various changes towards 3.0 branch by Brian Dolbec
1 ---
2 catalyst/config.py | 6 +-----
3 1 file changed, 1 insertion(+), 5 deletions(-)
4
5 diff --git a/catalyst/config.py b/catalyst/config.py
6 index 460bbd5..8b23342 100644
7 --- a/catalyst/config.py
8 +++ b/catalyst/config.py
9 @@ -54,11 +54,7 @@ class ParserBase:
10 # Skip any blank lines
11 if not myline: continue
12
13 - # Look for separator
14 - msearch = myline.find(self.key_value_separator)
15 -
16 - # If separator found assume its a new key
17 - if msearch != -1:
18 + if self.key_value_separator in myline:
19 # Split on the first occurence of the separator creating two strings in the array mobjs
20 mobjs = myline.split(self.key_value_separator, 1)
21 mobjs[1] = mobjs[1].strip().strip('"')
22 --
23 2.1.0