summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-09 09:25:32 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-09 09:25:32 +0000
commit5a647a3f5fd011f8558c7f9e90cd65e70e73eb40 (patch)
tree294dcb47e83e5480b1fa992aba8a4b4025c8a626 /file.c
parent250dd0702111d5c2086f007b1b31ecc1e36ade40 (diff)
* include/ruby/ruby.h (CONST_ID): constant ID cache for non-gcc.
* *.c: no cache in init functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/file.c b/file.c
index 1d1fab254d..5b99cf05b7 100644
--- a/file.c
+++ b/file.c
@@ -102,15 +102,14 @@ static VALUE
rb_get_path_check(VALUE obj, int check)
{
VALUE tmp;
- static ID to_path;
+ ID to_path;
if (check) rb_check_safe_obj(obj);
tmp = rb_check_string_type(obj);
if (!NIL_P(tmp)) goto exit;
- if (!to_path) {
- to_path = rb_intern("to_path");
- }
+
+ CONST_ID(to_path, "to_path");
if (rb_respond_to(obj, to_path)) {
tmp = rb_funcall(obj, to_path, 0, 0);
}