Created
February 27, 2015 00:23
-
-
Save paavohuhtala/47c9aced826fd4e9b67d to your computer and use it in GitHub Desktop.
c# LINQ vs java streams
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
private ArrayList<String> distinct() { | |
return (ArrayList<String>) list.stream().distinct().collect(Collectors.toList()); | |
} | |
vs | |
private List<string> Distinct() | |
{ | |
return list.Distinct().ToList(); | |
} | |
private int count(String type) { | |
return (int) list.stream().filter((t) -> t.equals(type)).count(); | |
} | |
vs | |
private int Count(string type) { | |
return list.Count(l => l == type); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment