Skip to content

Commit

Permalink
Avoid new HashSet allocation if there are no secrets (#1283)
Browse files Browse the repository at this point in the history
  • Loading branch information
gsmet authored Jan 7, 2025
1 parent dbde487 commit 26751b9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public ConfigValue getValue(final ConfigSourceInterceptorContext context, final

@Override
public Iterator<String> iterateNames(final ConfigSourceInterceptorContext context) {
if (SecretKeys.isLocked()) {
if (!secrets.isEmpty() && SecretKeys.isLocked()) {
Set<String> names = new HashSet<>();
Iterator<String> namesIterator = context.iterateNames();
while (namesIterator.hasNext()) {
Expand Down

0 comments on commit 26751b9

Please sign in to comment.