From 26557d24cc3e80445c4ce6792fb00e75e8697ef9 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Sun, 9 Feb 2020 11:34:51 +0300 Subject: [PATCH] Indexed comparison slightly faster than .startswith() --- pyderasn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.44.0