khash.h (kh_destroy): both kh_destroy_data and mrb_free works with NULL

This commit is contained in:
Yukihiro "Matz" Matsumoto
2025-08-02 11:57:07 +09:00
parent 378b4858fd
commit 344d28f961
+2 -4
View File
@@ -187,10 +187,8 @@ static const uint8_t __m_either[] = {0x03, 0x0c, 0x30, 0xc0};
} \
void kh_destroy_##name(mrb_state *mrb, kh_##name##_t *h) \
{ \
if (h) { \
kh_destroy_data_##name(mrb, h); \
mrb_free(mrb, h); \
} \
kh_destroy_data_##name(mrb, h); \
mrb_free(mrb, h); \
} \
void kh_clear_##name(mrb_state *mrb, kh_##name##_t *h) \
{ \