Remove unnecessary check in dc_array_new_typed

Allocating Vec with 0 capacity is correct.
This commit is contained in:
Alexander Krotov
2019-07-23 00:48:11 +03:00
parent f3eea41914
commit c7a6b3caae

View File

@@ -256,8 +256,7 @@ pub fn dc_array_new(initsize: size_t) -> *mut dc_array_t {
}
pub fn dc_array_new_typed(type_0: libc::c_int, initsize: size_t) -> *mut dc_array_t {
let capacity = if initsize < 1 { 1 } else { initsize as usize };
let mut array = dc_array_t::new(capacity);
let mut array = dc_array_t::new(initsize);
array.type_0 = type_0;
array.as_ptr()
}