Skip to content

Conversation

@DomGarguilo
Copy link
Member

@DomGarguilo DomGarguilo commented Oct 28, 2025

These are some pretty trivial, miscellaneous improvements that I saw while working on #302. Some improvements here are:

  • use of try-with-resources to replace manual closing of resources
  • simplified logic where possible

@DomGarguilo DomGarguilo self-assigned this Oct 28, 2025
Comment on lines -66 to +69
.peek(entry -> ContinuousWalk.validate(entry.getKey(), entry.getValue())).count();
long count = 0;
for (var entry : scanner) {
ContinuousWalk.validate(entry.getKey(), entry.getValue());
count++;
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My IDE was warning me that the .peek operation could possibly be optimized out by the compiler so I changed the syntax so that wouldnt happen

getAuthsMap().put(s, curVal);
}
curVal += increment;
getAuthsMap().merge(s, increment, Integer::sum);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method was not doing anything. I changed the code so that it actually updates the values of the map.

@DomGarguilo DomGarguilo merged commit 9bf9f84 into apache:2.1 Oct 30, 2025
1 check passed
@DomGarguilo DomGarguilo deleted the miscImprovements branch October 30, 2025 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant