Skip to content

Commit cff9f44

Browse files
committed
refactor: apply requested changes
1 parent 7100857 commit cff9f44

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

Lib/configparser.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -581,11 +581,10 @@ def _strip_full(self, string):
581581
return '' if any(map(string.startswith, self.comments.full)) else True
582582

583583
def _strip_inline(self, string):
584-
match = None
585584
if self.comments.inline:
586585
match = self.comments.inline.search(string)
587-
if match:
588-
return string[:match.start()].rstrip()
586+
if match:
587+
return string[:match.start()].rstrip()
589588
return string
590589

591590

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
Reduce :mod:`configparser`. :class:`RawConfigParser`. :meth:`read` performance
2-
regression that occurred after refactoring from 130% to 25%.
1+
Improve performance of :meth:`configparser.RawConfigParser.read` by up to 45%.

0 commit comments

Comments
 (0)