nonbinaryprogrammer commented on a change in pull request #6783:
URL: https://github.com/apache/geode/pull/6783#discussion_r705692218
##########
File path:
geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/data/RedisSortedSet.java
##########
@@ -818,15 +781,11 @@ protected int sizeValue(OrderedSetEntry value) {
public void toData(DataOutput out) throws IOException {
InternalDataSerializer.writePrimitiveInt(size(), out);
- final int maxIndex = getMaxIndex();
- for (int pos = 0; pos < maxIndex; ++pos) {
- OrderedSetEntry value = getValueAtIndex(pos);
- if (value != null) {
- byte[] member = value.getMember();
- byte[] score = value.getScoreBytes();
- InternalDataSerializer.writeByteArray(member, out);
- InternalDataSerializer.writeByteArray(score, out);
- }
+ for (Map.Entry<byte[], OrderedSetEntry> entry : entrySet()) {
+ byte[] member = entry.getKey();
+ double score = entry.getValue().getScore();
+ InternalDataSerializer.writeByteArray(member, out);
+ InternalDataSerializer.writeDouble(score, out);
Review comment:
sorry, thought I'd changed that
--
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]