Skip to content
This repository was archived by the owner on Nov 14, 2018. It is now read-only.

Commit f4d82f7

Browse files
committed
ClipData: prefer calling real API (#497)
Skip calling the extension to avoid overhead.
1 parent e868bc0 commit f4d82f7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/java/androidx/core/content/ClipData.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ operator fun ClipData.iterator() = object : Iterator<ClipData.Item> {
7171
*/
7272
inline fun <reified T> ClipData.map(transform: (ClipData.Item) -> T): List<T> {
7373
var m = mutableListOf<T>()
74-
forEach {
75-
m.add(transform(it))
74+
for (i in 0 until itemCount) {
75+
m.add(transform(getItemAt(i)))
7676
}
7777
return m.toList()
7878
}

0 commit comments

Comments
 (0)