Avoid String allocations with Assert.state()

This commit is contained in:
Sam Brannen
2022-11-04 16:44:59 +01:00
parent fff999f416
commit 2afcf60566
2 changed files with 4 additions and 2 deletions

View File

@@ -116,7 +116,8 @@ final class HttpServiceMethod {
break;
}
}
Assert.state(resolved, formatArgumentError(this.parameters[i], "No suitable resolver"));
int index = i;
Assert.state(resolved, () -> formatArgumentError(this.parameters[index], "No suitable resolver"));
}
}