[HUST CSE] 判断条件冗余 (#7430)

This commit is contained in:
LostCivilization 2023-05-01 07:38:25 +08:00 committed by GitHub
parent e12c2f9306
commit 106f635552
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 4 deletions

View File

@ -58,10 +58,7 @@ static void memheap_test(void)
{
if (operation == 0) /* free and malloc */
{
if (ptr[ptr_index])
{
rt_memheap_free(ptr[ptr_index]);
}
rt_memheap_free(ptr[ptr_index]);
ptr[ptr_index] = rt_memheap_alloc(&heap1, slice_size);
}
else /* realloc */