spring-data-redis
spring-data-redis copied to clipboard
fix: duplicated conditional TTL evaluation
Summary
This PR refactors duplicated TTL computation logic inside DefaultRedisCacheWriter's get method
following expression was previously evaluated twice
timeToIdleEnabled && withTtl ? ttl : null
What Changed
A new local variable ttlForGet is introduced to compute the TTL once
Closes: https://github.com/spring-projects/spring-data-redis/issues/3266