Tue, 23 Jan 2024 12:21:15 +0100
Did some small code optimizations.
src/eric7/EricNetwork/EricJsonClient.py | file | annotate | diff | comparison | revisions | |
src/eric7/Utilities/BackgroundClient.py | file | annotate | diff | comparison | revisions |
--- a/src/eric7/EricNetwork/EricJsonClient.py Tue Jan 23 11:32:20 2024 +0100 +++ b/src/eric7/EricNetwork/EricJsonClient.py Tue Jan 23 12:21:15 2024 +0100 @@ -57,7 +57,7 @@ def __receiveJson(self): """ - Private method to receive a JSON encode command and data from the + Private method to receive a JSON encoded command and data from the server. @return tuple containing the received command and a dictionary @@ -72,7 +72,7 @@ return None, None length = int(length) - data = b"" + data = bytearray() while len(data) < length: newData = self.__connection.recv(length - len(data)) if not newData:
--- a/src/eric7/Utilities/BackgroundClient.py Tue Jan 23 11:32:20 2024 +0100 +++ b/src/eric7/Utilities/BackgroundClient.py Tue Jan 23 12:21:15 2024 +0100 @@ -116,7 +116,7 @@ @return received bytes or None if connection closed @rtype bytes """ - data = b"" + data = bytearray() while len(data) < length: newData = self.connection.recv(length - len(data)) if not newData: