echuraev commented on code in PR #13420:
URL: https://github.com/apache/tvm/pull/13420#discussion_r1027918168


##########
python/tvm/rpc/base.py:
##########
@@ -136,13 +139,30 @@ def random_key(prefix, cmap=None):
     key : str
         The generated random key
     """
-    if cmap:
-        while True:
-            key = prefix + str(random.random())
-            if key not in cmap:
-                return key
-    else:
-        return prefix + str(random.random())
+    while True:
+        key = "{}{}{}".format(prefix, delimiter, random.random())
+        if not cmap or key not in cmap:
+            break

Review Comment:
   Ups, sorry, my bad. Didn't notice that. Thank you.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to