소스 검색

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