You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2022/04/19 14:11:42 UTC
[GitHub] [geode] jdeppe-pivotal commented on a diff in pull request #7579: GEODE-10161: Remove unnecessary synchronization from RedisList
jdeppe-pivotal commented on code in PR #7579:
URL: https://github.com/apache/geode/pull/7579#discussion_r853125966
##########
geode-for-redis/src/main/java/org/apache/geode/redis/internal/data/RedisList.java:
##########
@@ -265,7 +267,7 @@ public void lset(Region<RedisKey, RedisData> region, RedisKey key, int index, by
throw new RedisException(ERROR_INDEX_OUT_OF_RANGE);
}
- elementReplace(adjustedIndex, value);
+ elementList.set(adjustedIndex, value);
Review Comment:
Since we're not updating the `version` here this should be OK. Synchronization is implemented to allow atomic updates to both the version and the underlying structure. Additionally synchronization also prevents the possibility of `ConcurrentModificationException`s which this `set` call won't trigger since it's merely changing an existing value and not changing the structure (size) of the list.
--
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: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org