aboutsummaryrefslogtreecommitdiffstats
path: root/signal.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-01-26 05:33:28 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-01-26 05:33:28 +0000
commitef5d106e7eb12a45e50d122a2ce31782652b4ad9 (patch)
tree1de2fe805226a52bd752a09e18bd8139912e7787 /signal.c
parentd0a39748bf9441c389f33ee268df27817ccfaa6f (diff)
downloadruby-ef5d106e7eb12a45e50d122a2ce31782652b4ad9.tar.gz
Signal.list deduplicates keys
This allows us to reuse string objects used in symbols as well as any string representations of signal names in source code. * signal.c (sig_list): use fstring for hash key * test/ruby/test_signal.rb (test_signal_list_dedupe_keys): added git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'signal.c')
-rw-r--r--signal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/signal.c b/signal.c
index cac90db69c..492e682660 100644
--- a/signal.c
+++ b/signal.c
@@ -1347,7 +1347,7 @@ sig_list(void)
const struct signals *sigs;
for (sigs = siglist; sigs->signm; sigs++) {
- rb_hash_aset(h, rb_str_new2(sigs->signm), INT2FIX(sigs->signo));
+ rb_hash_aset(h, rb_fstring_cstr(sigs->signm), INT2FIX(sigs->signo));
}
return h;
}