Created
December 21, 2013 05:15
-
-
Save likwid/8065715 to your computer and use it in GitHub Desktop.
This file contains 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
Java: | |
public List<Item> bought(User user) | |
{ | |
List<Item> result = new ArrayList(); | |
for (Item item : currentItems) | |
{ | |
if (user.bought(item)) | |
{ | |
result.add(item); | |
} | |
} | |
return result; | |
} | |
Scala: | |
def bought(user: User) = items.filter(user bought _) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment