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>
This commit is contained in:
@@ -169,11 +169,11 @@ class Popen(subprocess.Popen):
|
|||||||
self.stdin.close()
|
self.stdin.close()
|
||||||
if self.stdout:
|
if self.stdout:
|
||||||
read_set.append(self.stdout)
|
read_set.append(self.stdout)
|
||||||
stdout = b''
|
stdout = bytearray()
|
||||||
if self.stderr and self.stderr != self.stdout:
|
if self.stderr and self.stderr != self.stdout:
|
||||||
read_set.append(self.stderr)
|
read_set.append(self.stderr)
|
||||||
stderr = b''
|
stderr = bytearray()
|
||||||
combined = b''
|
combined = bytearray()
|
||||||
|
|
||||||
input_offset = 0
|
input_offset = 0
|
||||||
while read_set or write_set:
|
while read_set or write_set:
|
||||||
|
Reference in New Issue
Block a user