From 35dfb3524664ea18b2699aa0d4273483e373a5e3 Mon Sep 17 00:00:00 2001 From: Svyatoslav Scherbina Date: Fri, 2 Dec 2016 13:09:09 +0700 Subject: [PATCH] Review feedback --- runtime/src/main/cpp/Exceptions.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/runtime/src/main/cpp/Exceptions.cpp b/runtime/src/main/cpp/Exceptions.cpp index f97d6b76d33..752ec13f447 100644 --- a/runtime/src/main/cpp/Exceptions.cpp +++ b/runtime/src/main/cpp/Exceptions.cpp @@ -36,12 +36,7 @@ class AutoFree { // TODO: this method ignores the encoding KString CreateKotlinStringFromCString(const char* str) { - int32_t length = strlen(str); - ArrayHeader* result = ArrayContainer(theStringTypeInfo, length).GetPlace(); - memcpy( - ByteArrayAddressOfElementAt(result, 0), - str, length); - return result; + return AllocStringInstance(str, strlen(str)); } #ifdef __cplusplus