diff options
| author | Matt Valentine-House <matt@eightbitraptor.com> | 2026-01-26 12:46:00 +0000 |
|---|---|---|
| committer | Matt Valentine-House <matt@eightbitraptor.com> | 2026-01-26 18:01:09 +0000 |
| commit | 3c634893e245c578181e8337b4025d1f673d77e8 (patch) | |
| tree | 490bf631e129d194f310032beb3932851ed1e6d8 | |
| parent | d15117e2937b78b0868e0f41336f6350bbf1a1c4 (diff) | |
Remove the unnecesary integer comparison
Most compilers will optimise this anyway
| -rw-r--r-- | gc.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -1282,9 +1282,7 @@ rb_gc_obj_needs_cleanup_p(VALUE obj) uintptr_t type = (uintptr_t)RTYPEDDATA(obj)->type; if (type & TYPED_DATA_EMBEDDED) { RUBY_DATA_FUNC dfree = ((const rb_data_type_t *)(type & TYPED_DATA_PTR_MASK))->function.dfree; - // Fast path for embedded T_DATA with no custom free function. - // True when dfree is NULL (RUBY_NEVER_FREE) or -1 (RUBY_TYPED_DEFAULT_FREE). - if ((uintptr_t)dfree + 1 <= 1) return false; + return (dfree == RUBY_NEVER_FREE || dfree == RUBY_TYPED_DEFAULT_FREE); } } return true; |
