Did some small code optimizations. eric7

Tue, 23 Jan 2024 12:21:15 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 23 Jan 2024 12:21:15 +0100
branch
eric7
changeset 10522
c04e878aa308
parent 10521
a51b382e47d7
child 10523
e4069ddd7dc7

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:

eric ide

mercurial