We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0207b0f commit 4d889f8Copy full SHA for 4d889f8
android/java/src/org/chromium/base/CollectionUtil.java
@@ -91,4 +91,13 @@ public static <T> List<T> strengthen(Collection<WeakReference<T>> weakRefs) {
91
}
92
return ret;
93
94
+
95
+ /** Flattens a collection of collections. */
96
+ public static <T> List<T> flatten(Collection<? extends Collection<T>> input) {
97
+ List<T> ret = new ArrayList<>();
98
+ for (Collection<T> inner : input) {
99
+ ret.addAll(inner);
100
+ }
101
+ return ret;
102
103
0 commit comments