From 6d5ba2a10884303dc52df2557a08f3a87d1299b1 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 24 Mar 2024 00:19:17 +0000 Subject: linux_inet_diag: remove needless OBJ_FREEZE calls OBJ_FREEZE before calling rb_hash_aset was actually preventing deduplication since Ruby 2.6. This introduces a performance regression for Ruby 2.5 users, but I expect the majority of users are on newer versions (I'm on 2.7, which is still ancient). --- ext/raindrops/linux_inet_diag.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'ext') diff --git a/ext/raindrops/linux_inet_diag.c b/ext/raindrops/linux_inet_diag.c index e4050cb..799b4da 100644 --- a/ext/raindrops/linux_inet_diag.c +++ b/ext/raindrops/linux_inet_diag.c @@ -159,7 +159,6 @@ static int st_to_hash(st_data_t key, st_data_t value, VALUE hash) VALUE k = remove_scope_id((const char *)key); VALUE v = rb_listen_stats(stats); - OBJ_FREEZE(k); rb_hash_aset(hash, k, v); } return st_free_data(key, value, 0); @@ -174,7 +173,6 @@ static int st_AND_hash(st_data_t key, st_data_t value, VALUE hash) if (rb_hash_lookup(hash, k) == Qtrue) { VALUE v = rb_listen_stats(stats); - OBJ_FREEZE(k); rb_hash_aset(hash, k, v); } } -- cgit v1.2.3-24-ge0c7