From: Sergey Matveev Date: Sun, 9 Feb 2020 08:34:51 +0000 (+0300) Subject: Indexed comparison slightly faster than .startswith() X-Git-Tag: 6.1~5 X-Git-Url: http://www.git.cypherpunks.ru/?p=pyderasn.git;a=commitdiff_plain;h=26557d24cc3e80445c4ce6792fb00e75e8697ef9 Indexed comparison slightly faster than .startswith() --- diff --git a/pyderasn.py b/pyderasn.py index 6c14e46..39f2d88 100755 --- a/pyderasn.py +++ b/pyderasn.py @@ -3818,7 +3818,7 @@ class Enumerated(Integer): def escape_control_unicode(c): - if unicat(c).startswith("C"): + if unicat(c)[0] == "C": c = repr(c).lstrip("u").strip("'") return c