Is there a way to rewrite this code in a more eleg...
# getting-started
e
Is there a way to rewrite this code in a more elegant and compact way?
Copy code
override fun equals(other: Any?): Boolean {
        if (other is StorageLinear)
            if (data.capacity() == other.data.capacity())
                for (i in 0..data.capacity()) {
                    if (data.get(i) != other.data.get(i)) return false
                }
            else return false
        else return false
        return true
    }