diff options
Diffstat (limited to 'java/jni/BluetoothGattDescriptor.cxx')
-rw-r--r-- | java/jni/BluetoothGattDescriptor.cxx | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/java/jni/BluetoothGattDescriptor.cxx b/java/jni/BluetoothGattDescriptor.cxx index 091e0be9..02b04dbe 100644 --- a/java/jni/BluetoothGattDescriptor.cxx +++ b/java/jni/BluetoothGattDescriptor.cxx @@ -69,11 +69,7 @@ jboolean Java_tinyb_BluetoothGattDescriptor_writeValue(JNIEnv *env, jobject obj, jbyte *native_array = env->GetByteArrayElements(argValue, &is_copy); jsize native_array_length = env->GetArrayLength(argValue); - std::vector<unsigned char> array(native_array_length); - for (int i = 0; i < native_array_length; ++i) - { - array.push_back(native_array[i]); - } + std::vector<unsigned char> array(native_array, native_array + native_array_length); return obj_gatt_desc->write_value(array) ? JNI_TRUE : JNI_FALSE; } |