Short-circuit if origin and destination is the same

This commit is contained in:
Reinhard Pointner 2019-06-01 23:27:50 +07:00
parent 658c940c45
commit 2b5e2a0785
1 changed files with 3 additions and 0 deletions

View File

@ -798,6 +798,9 @@ public class MediaBindingBean {
Episode e = getEpisode();
XEM origin = XEM.forName(e.getSeriesInfo().getDatabase());
XEM destination = XEM.forName(k);
if (origin == destination) {
return e;
}
return origin.map(e, destination).orElse(e);
}
return undefined(k);