Skip to content

Comments

Improve efficiency of getRendition#1

Open
HaroldPutman wants to merge 2 commits intoAvionosLLC:developfrom
HaroldPutman:or-else-get
Open

Improve efficiency of getRendition#1
HaroldPutman wants to merge 2 commits intoAvionosLLC:developfrom
HaroldPutman:or-else-get

Conversation

@HaroldPutman
Copy link

If you find the rendition by the requested name, there is no reason to try to find it by the basename also. But, orElse() on an
Optional will evaluate its parameter every time. Switching to orElseGet and a Suppler lambda expression prevents that.

Mark Daugherty and others added 2 commits April 24, 2020 09:56
`getRenditionForBaseName()` was being called whether or not getRenditionForName found the rendition.
Using orElseGet will only call it if the
rendition was not found.
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.

2 participants