]> Cypherpunks.ru repositories - pyderasn.git/commitdiff
Indexed comparison slightly faster than .startswith()
authorSergey Matveev <stargrave@stargrave.org>
Sun, 9 Feb 2020 08:34:51 +0000 (11:34 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sun, 9 Feb 2020 09:47:14 +0000 (12:47 +0300)
pyderasn.py

index 6c14e4619972a8a31e68fdafd8cefbd48f344659..39f2d885062a49f4e59b630e1305ffa21fede80b 100755 (executable)
@@ -3818,7 +3818,7 @@ class Enumerated(Integer):
 
 
 def escape_control_unicode(c):
 
 
 def escape_control_unicode(c):
-    if unicat(c).startswith("C"):
+    if unicat(c)[0] == "C":
         c = repr(c).lstrip("u").strip("'")
     return c
 
         c = repr(c).lstrip("u").strip("'")
     return c