Skip to content

Commit fc409fb

Browse files
committed
⬆️ up + fixed *buffer.lastIndex
1 parent 465de1a commit fc409fb

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/main/kotlin/uno/kotlin/buffers/_arrays.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4637,25 +4637,25 @@ inline fun CharBuffer.isNotEmpty() = !isEmpty()
46374637

46384638

46394639
/** Returns the last valid index for the buffer. */
4640-
val ByteBuffer.lastIndex get() = size - 1
4640+
val ByteBuffer.lastIndex get() = capacity - 1
46414641

46424642
/** Returns the last valid index for the buffer. */
4643-
val ShortBuffer.lastIndex get() = size - 1
4643+
val ShortBuffer.lastIndex get() = capacity - 1
46444644

46454645
/** Returns the last valid index for the buffer. */
4646-
val IntBuffer.lastIndex get() = size - 1
4646+
val IntBuffer.lastIndex get() = capacity - 1
46474647

46484648
/** Returns the last valid index for the buffer. */
4649-
val LongBuffer.lastIndex get() = size - 1
4649+
val LongBuffer.lastIndex get() = capacity - 1
46504650

46514651
/** Returns the last valid index for the buffer. */
4652-
val FloatBuffer.lastIndex get() = size - 1
4652+
val FloatBuffer.lastIndex get() = capacity - 1
46534653

46544654
/** Returns the last valid index for the buffer. */
4655-
val DoubleBuffer.lastIndex get() = size - 1
4655+
val DoubleBuffer.lastIndex get() = capacity - 1
46564656

46574657
/** Returns the last valid index for the buffer. */
4658-
val CharBuffer.lastIndex get() = size - 1
4658+
val CharBuffer.lastIndex get() = capacity - 1
46594659

46604660

46614661
/** Returns a buffer containing all elements of the original buffer and then the given [element]. */

0 commit comments

Comments
 (0)