WJSGDBZ commented on code in PR #2305:
URL:
https://github.com/apache/incubator-pegasus/pull/2305#discussion_r2444887334
##########
python-client/pypegasus/pgclient.py:
##########
@@ -611,24 +620,43 @@ def generate_key(cls, hash_key, sort_key):
@classmethod
def generate_next_bytes(cls, buff):
- pos = len(buff) - 1
+ is_str = isinstance(buff, str)
+ is_ba = isinstance(buff, bytearray)
+
+ if is_str:
+ arr = bytearray(buff.encode('latin-1'))
Review Comment:
The original logic uses buff[pos] += 1, implying a 'latin-1' encoding where
each character corresponds to a single byte. This assumption is preserved and
we have added annotations to explain.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]