From 9f57bde8530c821d59c9f7e7c1935359b8411ac9 Mon Sep 17 00:00:00 2001 From: James Lu Date: Thu, 23 Feb 2017 17:30:34 -0800 Subject: [PATCH] ircutils: remove redundant str.replace As strings, '\x0f' == '\x0F', and '\x1f' == '\x1F' --- src/ircutils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ircutils.py b/src/ircutils.py index 5f1168c81..bf91424d3 100644 --- a/src/ircutils.py +++ b/src/ircutils.py @@ -375,7 +375,7 @@ def stripReverse(s): def stripUnderline(s): """Returns the string s, with underlining removed.""" - return s.replace('\x1f', '').replace('\x1F', '') + return s.replace('\x1f', '') def stripFormatting(s): """Returns the string s, with all formatting removed.""" @@ -385,7 +385,7 @@ def stripFormatting(s): s = stripReverse(s) s = stripUnderline(s) s = stripItalic(s) - return s.replace('\x0f', '').replace('\x0F', '') + return s.replace('\x0f', '') _containsFormattingRe = re.compile(r'[\x02\x03\x16\x1f]') def formatWhois(irc, replies, caller='', channel='', command='whois'):