Minor. Rename compactIfPossible -> compact

As ArrayList can always be compacted
This commit is contained in:
Denis Zharkov
2017-07-18 12:40:43 +03:00
parent f454858bbb
commit 99a10d8d63
8 changed files with 18 additions and 18 deletions
@@ -78,7 +78,7 @@ fun <E> newLinkedHashSetWithExpectedSize(expectedSize: Int): LinkedHashSet<E> =
private fun capacity(expectedSize: Int): Int =
if (expectedSize < 3) 3 else expectedSize + expectedSize / 3 + 1
fun <T> ArrayList<T>.compactIfPossible(): List<T> =
fun <T> ArrayList<T>.compact(): List<T> =
when (size) {
0 -> emptyList()
1 -> listOf(first())