summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-07-06 19:36:40 +0300
committerSimon Glass <sjg@chromium.org>2021-07-21 19:27:35 +0300
commitc31d0cb68c1c29f210ab44803f5e5fdcdcfa250b (patch)
treefa83c853b072032eb3afa6ac981c6f6449c8008b /tools
parent43332d881baa2d66a18e80ec636e0e0da5623c46 (diff)
downloadu-boot-c31d0cb68c1c29f210ab44803f5e5fdcdcfa250b.tar.xz
patman: Use bytearray instead of string
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>
Diffstat (limited to 'tools')
-rw-r--r--tools/patman/cros_subprocess.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/patman/cros_subprocess.py b/tools/patman/cros_subprocess.py
index efd0a5aaf7..fdd5138685 100644
--- a/tools/patman/cros_subprocess.py
+++ b/tools/patman/cros_subprocess.py
@@ -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: