Skip to content

Commit

Permalink
avoid array allocation in ResponseCacheImpl
Browse files Browse the repository at this point in the history
  • Loading branch information
sullis committed Jan 22, 2023
1 parent 191cc40 commit 14c5103
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@
* @author Karthik Ranganathan, Greg Kim
*/
public class ResponseCacheImpl implements ResponseCache {
private static final Key.KeyType[] KEY_TYPE_VALUES = Key.KeyType.values();
private static final Version[] VERSION_VALUES = Version.values();

private static final Logger logger = LoggerFactory.getLogger(ResponseCacheImpl.class);

Expand Down Expand Up @@ -249,8 +251,8 @@ public void stop() {
*/
@Override
public void invalidate(String appName, @Nullable String vipAddress, @Nullable String secureVipAddress) {
for (Key.KeyType type : Key.KeyType.values()) {
for (Version v : Version.values()) {
for (Key.KeyType type : KEY_TYPE_VALUES) {
for (Version v : VERSION_VALUES) {
invalidate(
new Key(Key.EntityType.Application, appName, type, v, EurekaAccept.full),
new Key(Key.EntityType.Application, appName, type, v, EurekaAccept.compact),
Expand Down

0 comments on commit 14c5103

Please sign in to comment.