浏览代码

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

LostCivilization 2 年之前
父节点
当前提交
106f635552
共有 1 个文件被更改,包括 1 次插入4 次删除
  1. 1 4
      examples/utest/testcases/kernel/memheap_tc.c

+ 1 - 4
examples/utest/testcases/kernel/memheap_tc.c

@@ -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 */