Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Optional.orElse() calls with Optional.orElseGet() #2450

Merged
merged 1 commit into from
Oct 20, 2023

Conversation

picimako
Copy link
Contributor

Replaced Optional.orElse() calls with Optional.orElseGet() where it was applicable, so that dynamic values are evaluated lazily, and only when needed.

References

#2442

Submitter checklist

  • Recommended: Join WireMock Slack to get any help in #help-contributing or a project-specific channel like #wiremock-java
  • Recommended: If you participate in Hacktoberfest 2023, make sure you're signed up there and in the WireMock form
  • The PR request is well described and justified, including the body and the references
  • The PR title represents the desired changelog entry
  • The repository's code style is followed (see the contributing guide)
  • Test coverage that demonstrates that the change works as expected
  • For new features, there's necessary documentation in this pull request or in a subsequent PR to wiremock.org

Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

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

it is a reasonable improvement though it won't have serious advantage for most of the occurrences

@oleg-nenashev oleg-nenashev added the chore Maintenance label Oct 17, 2023
@oleg-nenashev oleg-nenashev merged commit bf6762a into wiremock:master Oct 20, 2023
7 checks passed
PhilippSchueler5648 pushed a commit to julianahrens1999/wiremock that referenced this pull request Oct 24, 2023
@picimako picimako deleted the optional-orelseget branch November 7, 2023 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants