mirror of
https://github.com/chatmail/core.git
synced 2026-05-02 12:56:30 +03:00
Remove unnecessary check in dc_array_new_typed
Allocating Vec with 0 capacity is correct.
This commit is contained in:
@@ -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 {
|
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(initsize);
|
||||||
let mut array = dc_array_t::new(capacity);
|
|
||||||
array.type_0 = type_0;
|
array.type_0 = type_0;
|
||||||
array.as_ptr()
|
array.as_ptr()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user