Skip to content

Commit

Permalink
Kotlin 1.3.50 (#649)
Browse files Browse the repository at this point in the history
* Kotlin 1.3.50

Replace Array.fill usage with new Array.fill extension from stdlib.

* Remove unused import
  • Loading branch information
JakeWharton authored and Egor Andreevich committed Aug 23, 2019
1 parent 29c16f9 commit 589c56c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
buildscript {
ext.versions = [
'kotlin': '1.3.50-eap-86',
'kotlin': '1.3.50',
'jmhPlugin': '0.4.8',
'animalSnifferPlugin': '1.5.0',
'dokka': '0.9.18',
Expand Down
5 changes: 2 additions & 3 deletions okio/src/jvmTest/kotlin/okio/BufferCursorKotlinTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import org.junit.runner.RunWith
import org.junit.runners.Parameterized
import org.junit.runners.Parameterized.Parameter
import org.junit.runners.Parameterized.Parameters
import java.util.Arrays
import kotlin.test.assertEquals
import kotlin.test.assertFalse
import kotlin.test.assertNotSame
Expand Down Expand Up @@ -98,7 +97,7 @@ class BufferCursorKotlinTest {

buffer.readAndWriteUnsafe().use { cursor ->
while (cursor.next() != -1) {
Arrays.fill(cursor.data!!, cursor.start, cursor.end, 'x'.toByte())
cursor.data!!.fill('x'.toByte(), cursor.start, cursor.end)
}
}

Expand Down Expand Up @@ -127,4 +126,4 @@ class BufferCursorKotlinTest {
cursor.close()
assertSame(null, cursor.buffer)
}
}
}
8 changes: 2 additions & 6 deletions okio/src/jvmTest/kotlin/okio/TestUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,7 @@ object TestUtil {
}

@JvmStatic
fun repeat(c: Char, count: Int): String {
val array = CharArray(count)
Arrays.fill(array, c)
return String(array)
}
fun repeat(c: Char, count: Int) = c.toString().repeat(count)

@JvmStatic
fun assertEquivalent(b1: ByteString, b2: ByteString) {
Expand Down Expand Up @@ -296,4 +292,4 @@ object TestUtil {
/* ktlint-enable no-multi-spaces indent */
return reversed.toShort()
}
}
}

0 comments on commit 589c56c

Please sign in to comment.