<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[What Wrong With This One? So much :V]]></title><description><![CDATA[<pre><code>actual constructor() : this(10)

    actual constructor(initialCapacity: Int) : this(
            arrayOfUninitializedElements(initialCapacity), 0, 0, false, null, null)

    actual constructor(elements: Collection&lt;E&gt;) : this(elements.size) {
        addAll(elements)
    }

    @PublishedApi
    internal fun build(): List&lt;E&gt; {
        if (backing != null) throw IllegalStateException() // just in case somebody casts subList to ArrayList
        checkIsMutable()
        isReadOnly = true
        return this
    }

    override actual val size: Int
        get() = length

    override actual fun isEmpty(): Boolean = length == 0

    override actual fun get(index: Int): E {
        checkElementIndex(index)
        return array[offset + index]
    }

    override actual operator fun set(index: Int, element: E): E {
        checkIsMutable()
        checkElementIndex(index)
        val old = array[offset + index]
        array[offset + index] = element
        return old
    }

    override actual fun indexOf(element: E): Int {
        var i = 0
        while (i &lt; length) {
            if (array[offset + i] == element) return i
            i++
        }
        return -1
    }

    override actual fun lastIndexOf(element: E): Int {
        var i = length - 1
        while (i &gt;= 0) {
            if (array[offset + i] == element) return i
            i--
        }
        return -1
    }

    override actual fun iterator(): MutableIterator&lt;E&gt; = Itr(this, 0)
    override actual fun listIterator(): MutableListIterator&lt;E&gt; = Itr(this, 0)

    override actual fun listIterator(index: Int): MutableListIterator&lt;E&gt; {
        checkPositionIndex(index)
        return Itr(this, index)
    }

    override actual fun add(element: E): Boolean {
        checkIsMutable()
        addAtInternal(offset + length, element)
        return true
    }

    override actual fun add(index: Int, element: E) {
        checkIsMutable()
        checkPositionIndex(index)
        addAtInternal(offset + index, element)
    }

    override actual fun addAll(elements: Collection&lt;E&gt;): Boolean {
        checkIsMutable()
        val n = elements.size
        addAllInternal(offset + length, elements, n)
        return n &gt; 0
    }

    override actual fun addAll(index: Int, elements: Collection&lt;E&gt;): Boolean {
        checkIsMutable()
        checkPositionIndex(index)
        val n = elements.size
        addAllInternal(offset + index, elements, n)
        return n &gt; 0
    }

    override actual fun clear() {
        checkIsMutable()
        removeRangeInternal(offset, length)
    }

    override actual fun removeAt(index: Int): E {
        checkIsMutable()
        checkElementIndex(index)
        return removeAtInternal(offset + index)
    }

    override actual fun remove(element: E): Boolean {
        checkIsMutable()
        val i = indexOf(element)
        if (i &gt;= 0) removeAt(i)
        return i &gt;= 0
    }

    override actual fun removeAll(elements: Collection&lt;E&gt;): Boolean {
        checkIsMutable()
        return retainOrRemoveAllInternal(offset, length, elements, false) &gt; 0
    }

    override actual fun retainAll(elements: Collection&lt;E&gt;): Boolean {
        checkIsMutable()
        return retainOrRemoveAllInternal(offset, length, elements, true) &gt; 0
    }

    override actual fun subList(fromIndex: Int, toIndex: Int): MutableList&lt;E&gt; {
        checkRangeIndexes(fromIndex, toIndex)
        return ArrayList(array, offset + fromIndex, toIndex - fromIndex, isReadOnly, this, root ?: this)
    }

    actual fun trimToSize() {
        if (backing != null) throw IllegalStateException() // just in case somebody casts subList to ArrayList
        if (length &lt; array.size)
            array = array.copyOfUninitializedElements(length)
    }

    @OptIn(ExperimentalStdlibApi::class)
    final actual fun ensureCapacity(minCapacity: Int) {
        if (backing != null) throw IllegalStateException() // just in case somebody casts subList to ArrayList
        if (minCapacity &gt; array.size) {
            val newSize = ArrayDeque.newCapacity(array.size, minCapacity)
            array = array.copyOfUninitializedElements(newSize)
        }
    }

    override fun equals(other: Any?): Boolean {
        return other === this ||
                (other is List&lt;*&gt;) &amp;&amp; contentEquals(other)
    }

    override fun hashCode(): Int {
        return array.subarrayContentHashCode(offset, length)
    }

    override fun toString(): String {
        @Suppress("DEPRECATION")
        return array.subarrayContentToString(offset, length)
    }

    // ---------------------------- private ----------------------------

    private fun checkElementIndex(index: Int) {
        if (index &lt; 0 || index &gt;= length) {
            throw IndexOutOfBoundsException("index: $index, size: $length")
        }
    }

    private fun checkPositionIndex(index: Int) {
        if (index &lt; 0 || index &gt; length) {
            throw IndexOutOfBoundsException("index: $index, size: $length")
        }
    }

    private fun checkRangeIndexes(fromIndex: Int, toIndex: Int) {
        if (fromIndex &lt; 0 || toIndex &gt; length) {
            throw IndexOutOfBoundsException("fromIndex: $fromIndex, toIndex: $toIndex, size: $length")
        }
        if (fromIndex &gt; toIndex) {
            throw IllegalArgumentException("fromIndex: $fromIndex &gt; toIndex: $toIndex")
        }
    }

    private fun checkIsMutable() {
        if (isReadOnly || root != null &amp;&amp; root.isReadOnly) throw UnsupportedOperationException()
    }

    private fun ensureExtraCapacity(n: Int) {
        ensureCapacity(length + n)
    }

    private fun contentEquals(other: List&lt;*&gt;): Boolean {
        return array.subarrayContentEquals(offset, length, other)
    }

    private fun insertAtInternal(i: Int, n: Int) {
        ensureExtraCapacity(n)
        array.copyInto(array, startIndex = i, endIndex = offset + length, destinationOffset = i + n)
        length += n
    }

    private fun addAtInternal(i: Int, element: E) {
        if (backing != null) {
            backing.addAtInternal(i, element)
            array = backing.array
            length++
        } else {
            insertAtInternal(i, 1)
            array[i] = element
        }
    }

    private fun addAllInternal(i: Int, elements: Collection&lt;E&gt;, n: Int) {
        if (backing != null) {
            backing.addAllInternal(i, elements, n)
            array = backing.array
            length += n
        } else {
            insertAtInternal(i, n)
            var j = 0
            val it = elements.iterator()
            while (j &lt; n) {
                array[i + j] = it.next()
                j++
            }
        }
    }

    private fun removeAtInternal(i: Int): E {
        if (backing != null) {
            val old = backing.removeAtInternal(i)
            length--
            return old
        } else {
            val old = array[i]
            array.copyInto(array, startIndex = i + 1, endIndex = offset + length, destinationOffset = i)
            array.resetAt(offset + length - 1)
            length--
            return old
        }
    }

    private fun removeRangeInternal(rangeOffset: Int, rangeLength: Int) {
        if (backing != null) {
            backing.removeRangeInternal(rangeOffset, rangeLength)
        } else {
            array.copyInto(array, startIndex = rangeOffset + rangeLength, endIndex = length, destinationOffset = rangeOffset)
            array.resetRange(fromIndex = length - rangeLength, toIndex = length)
        }
        length -= rangeLength
    }

    /** Retains elements if [retain] == true and removes them it [retain] == false. */
    private fun retainOrRemoveAllInternal(rangeOffset: Int, rangeLength: Int, elements: Collection&lt;E&gt;, retain: Boolean): Int {
        if (backing != null) {
            val removed = backing.retainOrRemoveAllInternal(rangeOffset, rangeLength, elements, retain)
            length -= removed
            return removed
        } else {
            var i = 0
            var j = 0
            while (i &lt; rangeLength) {
                if (elements.contains(array[rangeOffset + i]) == retain) {
                    array[rangeOffset + j++] = array[rangeOffset + i++]
                } else {
                    i++
                }
            }
            val removed = rangeLength - j
            array.copyInto(array, startIndex = rangeOffset + rangeLength, endIndex = length, destinationOffset = rangeOffset + j)
            array.resetRange(fromIndex = length - removed, toIndex = length)
            length -= removed
            return removed
        }
    }

    private class Itr&lt;E&gt; : MutableListIterator&lt;E&gt; {
        private val list: ArrayList&lt;E&gt;
        private var index: Int
        private var lastIndex: Int

        constructor(list: ArrayList&lt;E&gt;, index: Int) {
            this.list = list
            this.index = index
            this.lastIndex = -1
        }

        override fun hasPrevious(): Boolean = index &gt; 0
        override fun hasNext(): Boolean = index &lt; list.length

        override fun previousIndex(): Int = index - 1
        override fun nextIndex(): Int = index

        override fun previous(): E {
            if (index &lt;= 0) throw NoSuchElementException()
            lastIndex = --index
            return list.array[list.offset + lastIndex]
        }

        override fun next(): E {
            if (index &gt;= list.length) throw NoSuchElementException()
            lastIndex = index++
            return list.array[list.offset + lastIndex]
        }

        override fun set(element: E) {
            check(lastIndex != -1) { "Call next() or previous() before replacing element from the iterator." }
            list.set(lastIndex, element)
        }

        override fun add(element: E) {
            list.add(index++, element)
            lastIndex = -1
        }

        override fun remove() {
            check(lastIndex != -1) { "Call next() or previous() before removing element from the iterator." }
            list.removeAt(lastIndex)
            index = lastIndex
            lastIndex = -1
        }
    }
}

private fun &lt;T&gt; Array&lt;T&gt;.subarrayContentHashCode(offset: Int, length: Int): Int {
    var result = 1
    var i = 0
    while (i &lt; length) {
        val nextElement = this[offset + i]
        result = result * 31 + nextElement.hashCode()
        i++
    }
    return result
}

private fun &lt;T&gt; Array&lt;T&gt;.subarrayContentEquals(offset: Int, length: Int, other: List&lt;*&gt;): Boolean {
    if (length != other.size) return false
    var i = 0
    while (i &lt; length) {
        if (this[offset + i] != other[i]) return false
        i++
    }
    return true
}
</code></pre>
]]></description><link>https://forum.liquidbounce.net/topic/423/what-wrong-with-this-one-so-much-v</link><generator>RSS for Node</generator><lastBuildDate>Sun, 08 Mar 2026 07:48:34 GMT</lastBuildDate><atom:link href="https://forum.liquidbounce.net/topic/423.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 11 Aug 2020 09:13:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to What Wrong With This One? So much :V on Tue, 24 Aug 2021 19:26:30 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chocopie_isme">@<bdi>chocopie_isme</bdi></a> its a code as you can see</p>
]]></description><link>https://forum.liquidbounce.net/post/23654</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/23654</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Tue, 24 Aug 2021 19:26:30 GMT</pubDate></item><item><title><![CDATA[Reply to What Wrong With This One? So much :V on Sat, 15 Aug 2020 04:53:09 GMT]]></title><description><![CDATA[<p dir="auto">the average thread iq is going down</p>
]]></description><link>https://forum.liquidbounce.net/post/3162</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/3162</guid><dc:creator><![CDATA[Aftery]]></dc:creator><pubDate>Sat, 15 Aug 2020 04:53:09 GMT</pubDate></item><item><title><![CDATA[Reply to What Wrong With This One? So much :V on Sat, 15 Aug 2020 04:51:29 GMT]]></title><description><![CDATA[<p dir="auto">I mean, you copied the code from another client?</p>
]]></description><link>https://forum.liquidbounce.net/post/3161</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/3161</guid><dc:creator><![CDATA[Azure1]]></dc:creator><pubDate>Sat, 15 Aug 2020 04:51:29 GMT</pubDate></item><item><title><![CDATA[Reply to What Wrong With This One? So much :V on Sat, 15 Aug 2020 04:48:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/azure">@<bdi>Azure</bdi></a> huh, it does not same for the other client just visual</p>
]]></description><link>https://forum.liquidbounce.net/post/3160</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/3160</guid><dc:creator><![CDATA[Sydneory Z]]></dc:creator><pubDate>Sat, 15 Aug 2020 04:48:44 GMT</pubDate></item><item><title><![CDATA[Reply to What Wrong With This One? So much :V on Tue, 11 Aug 2020 16:33:00 GMT]]></title><description><![CDATA[<p dir="auto">did you just copy this from another client?</p>
]]></description><link>https://forum.liquidbounce.net/post/2851</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/2851</guid><dc:creator><![CDATA[Azure]]></dc:creator><pubDate>Tue, 11 Aug 2020 16:33:00 GMT</pubDate></item><item><title><![CDATA[Reply to What Wrong With This One? So much :V on Tue, 11 Aug 2020 11:08:22 GMT]]></title><description><![CDATA[<p dir="auto">you<br />
//8chars</p>
]]></description><link>https://forum.liquidbounce.net/post/2828</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/2828</guid><dc:creator><![CDATA[Litely]]></dc:creator><pubDate>Tue, 11 Aug 2020 11:08:22 GMT</pubDate></item><item><title><![CDATA[Reply to What Wrong With This One? So much :V on Tue, 11 Aug 2020 09:20:35 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chocopie_isme">@<bdi>ChocoPie_isme</bdi></a> an error dont watch this<br />
ArrayList.kt</p>
]]></description><link>https://forum.liquidbounce.net/post/2822</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/2822</guid><dc:creator><![CDATA[Sydneory Z]]></dc:creator><pubDate>Tue, 11 Aug 2020 09:20:35 GMT</pubDate></item><item><title><![CDATA[Reply to What Wrong With This One? So much :V on Tue, 11 Aug 2020 09:19:06 GMT]]></title><description><![CDATA[<p dir="auto">wtf is this shit</p>
]]></description><link>https://forum.liquidbounce.net/post/2820</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/2820</guid><dc:creator><![CDATA[ChocoPie_isme]]></dc:creator><pubDate>Tue, 11 Aug 2020 09:19:06 GMT</pubDate></item><item><title><![CDATA[Reply to What Wrong With This One? So much :V on Tue, 11 Aug 2020 09:18:12 GMT]]></title><description><![CDATA[<p dir="auto">omg! icedoll !1!!11!1! aftegay</p>
]]></description><link>https://forum.liquidbounce.net/post/2819</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/2819</guid><dc:creator><![CDATA[Sydneory Z]]></dc:creator><pubDate>Tue, 11 Aug 2020 09:18:12 GMT</pubDate></item><item><title><![CDATA[Reply to What Wrong With This One? So much :V on Tue, 11 Aug 2020 09:15:56 GMT]]></title><description><![CDATA[<p dir="auto">you<a class="plugin-markdown-hidden-link small link-danger"></a><a class="plugin-markdown-hidden-link small link-danger"></a></p>
]]></description><link>https://forum.liquidbounce.net/post/2818</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/2818</guid><dc:creator><![CDATA[Aftery]]></dc:creator><pubDate>Tue, 11 Aug 2020 09:15:56 GMT</pubDate></item></channel></rss>