summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-01-18 18:14:47 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-01-18 18:14:47 +0900
commiteb96e4e98150435f1473afcef20d231f80724b47 (patch)
tree3a30d676624b5b13a2e22e6a83b195c01d56ecd0 /dir.c
parent79f0ed3529c096c1182ccfeb7a4ad316455fc90e (diff)
Made glob option keyword IDs static
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/dir.c b/dir.c
index 56dfe61..6734559 100644
--- a/dir.c
+++ b/dir.c
@@ -2755,10 +2755,12 @@ dir_globs(long argc, const VALUE *argv, VALUE base, int flags)
static void
dir_glob_options(VALUE opt, VALUE *base, int *flags)
{
- ID kw[2];
+ static ID kw[2];
VALUE args[2];
- kw[0] = rb_intern("base");
- if (flags) kw[1] = rb_intern("flags");
+ if (!kw[0]) {
+ kw[0] = rb_intern_const("base");
+ kw[1] = rb_intern_const("flags");
+ }
rb_get_kwargs(opt, kw, 0, flags ? 2 : 1, args);
if (args[0] == Qundef || NIL_P(args[0])) {
*base = Qnil;