From ebbb562cb93d507257f76669d5c7c0ebd4caef65 Mon Sep 17 00:00:00 2001 From: stsypanov Date: Sun, 8 Dec 2019 23:39:38 +0200 Subject: [PATCH] Hoist constant result of SerializableTypeWrapper.unwrap() out of loop --- .../src/main/java/org/springframework/core/ResolvableType.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-core/src/main/java/org/springframework/core/ResolvableType.java b/spring-core/src/main/java/org/springframework/core/ResolvableType.java index 994a395cf7..e17d509577 100644 --- a/spring-core/src/main/java/org/springframework/core/ResolvableType.java +++ b/spring-core/src/main/java/org/springframework/core/ResolvableType.java @@ -1496,9 +1496,9 @@ public class ResolvableType implements Serializable { @Override @Nullable public ResolvableType resolveVariable(TypeVariable variable) { + TypeVariable v2 = SerializableTypeWrapper.unwrap(variable); for (int i = 0; i < this.variables.length; i++) { TypeVariable v1 = SerializableTypeWrapper.unwrap(this.variables[i]); - TypeVariable v2 = SerializableTypeWrapper.unwrap(variable); if (ObjectUtils.nullSafeEquals(v1, v2)) { return this.generics[i]; }