]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
patman: Use bytearray instead of string
authorSimon Glass <sjg@chromium.org>
Tue, 6 Jul 2021 16:36:40 +0000 (10:36 -0600)
committerSimon Glass <sjg@chromium.org>
Wed, 21 Jul 2021 16:27:35 +0000 (10:27 -0600)
If the process outputs a lot of data on stdout this can be quite slow,
since the bytestring is regenerated each time. Use a bytearray instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/patman/cros_subprocess.py

index efd0a5aaf72f04d9f7ffb963b0a2045910dab920..fdd51386856f987095bad3ea29e1081a60423b31 100644 (file)
@@ -169,11 +169,11 @@ class Popen(subprocess.Popen):
                 self.stdin.close()
         if self.stdout:
             read_set.append(self.stdout)
-            stdout = b''
+            stdout = bytearray()
         if self.stderr and self.stderr != self.stdout:
             read_set.append(self.stderr)
-            stderr = b''
-        combined = b''
+            stderr = bytearray()
+        combined = bytearray()
 
         input_offset = 0
         while read_set or write_set: