Created
October 26, 2017 12:30
-
-
Save Romain-P/ea96ea8eb9477f318c5e803625d4dadf to your computer and use it in GitHub Desktop.
what's the most maintainable? ;")
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for (...) { | |
| Class found = null; | |
| for (Class i: bc.getInterfaces()) { | |
| if (i == requestClass) { | |
| success.add(new RetrievedBinding(requestClass, bc.getInstance(), bd.named(), bd.singleton())); | |
| found = i; | |
| break; | |
| } | |
| } | |
| if (found != null) break; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for (...) { | |
| if (bc.getInterfaces().stream() | |
| .filter(i -> i == requestClass).findFirst() | |
| .map(i -> success.add(new RetrievedBinding(requestClass, bc.getInstance(), bd.named(), bd.singleton()))) | |
| .isPresent()) | |
| break; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment