Skip to content

Commit

Permalink
Avoid new HashSet allocation if there are no secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
gsmet committed Jan 7, 2025
1 parent 2bcff37 commit 5198abd
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 5198abd

Please sign in to comment.