summaryrefslogtreecommitdiffstats
path: root/contrib/python/PyHamcrest/patches/01-speedup.patch
diff options
context:
space:
mode:
authorarcadia-devtools <[email protected]>2022-05-24 19:39:36 +0300
committerarcadia-devtools <[email protected]>2022-05-24 19:39:36 +0300
commit35cc60add498c5117afaf31bef949ac7e281b182 (patch)
tree1071310c216b15ea4bc9c5037cc964d9e06db692 /contrib/python/PyHamcrest/patches/01-speedup.patch
parente62a28e708a9c85b312652ff618f8a64d17b2dbc (diff)
intermediate changes
ref:17a230a3419e9a5f0286356df636f0071dc757b6
Diffstat (limited to 'contrib/python/PyHamcrest/patches/01-speedup.patch')
-rw-r--r--contrib/python/PyHamcrest/patches/01-speedup.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/contrib/python/PyHamcrest/patches/01-speedup.patch b/contrib/python/PyHamcrest/patches/01-speedup.patch
new file mode 100644
index 00000000000..9e8a36de14d
--- /dev/null
+++ b/contrib/python/PyHamcrest/patches/01-speedup.patch
@@ -0,0 +1,28 @@
+commit 4dc0f71a2788ed3530b053c0363738a8964f6a86
+author: asatarin
+date: 2017-10-13T16:14:43+03:00
+revision: 3199619
+
+ REVIEW:340199 Speed up StringDescription
+
+--- contrib/python/PyHamcrest/hamcrest/core/string_description.py (94523234ff338f573e50b70f8cf7f6c8456bd3a1)
++++ contrib/python/PyHamcrest/hamcrest/core/string_description.py (4dc0f71a2788ed3530b053c0363738a8964f6a86)
+@@ -24,15 +24,14 @@ def tostring(selfdescribing):
+ class StringDescription(BaseDescription):
+ """A :py:class:`~hamcrest.core.description.Description` that is stored as a
+ string.
+-
+ """
+
+ def __init__(self):
+- self.out = ''
++ self.__out_list = []
+
+ def __str__(self):
+ """Returns the description."""
+- return self.out
++ return ''.join(self.__out_list)
+
+ def append(self, string):
+- self.out += six.text_type(string)
++ self.__out_list.append(six.text_type(string))