Make a more correct implementation of unsigned arrays copyInto

Return the destination array instead of the destination storage array
wrapped in a new unsigned array. The difference should be
indistinguishable, however in JS, where inline classes are not inlined yet,
it had resulted in an extra wrapper.
This commit is contained in:
Ilya Gorbunov
2018-09-26 05:01:57 +03:00
parent 1a20b1f357
commit 0c81e30d46
2 changed files with 12 additions and 5 deletions
@@ -517,7 +517,10 @@ object ArrayOps : TemplateGroupBase() {
specialFor(ArraysOfUnsigned) {
inlineOnly()
body {
"return SELF(storage.copyInto(destination.storage, destinationOffset, startIndex, endIndex))"
"""
storage.copyInto(destination.storage, destinationOffset, startIndex, endIndex)
return destination
"""
}
}
specialFor(ArraysOfPrimitives, InvariantArraysOfObjects) {