follow-up: style adjustments (see GH-2)

This commit is contained in:
cremno 2013-10-22 15:24:55 +02:00
parent 071ad5d961
commit 8c45a5b11e
1 changed files with 3 additions and 2 deletions

View File

@ -165,10 +165,11 @@ static VALUE stringForceUTF8(VALUE arg)
return arg; return arg;
} }
static VALUE marshal_load_custom_proc(VALUE arg, VALUE proc) static VALUE customProc(VALUE arg, VALUE proc)
{ {
VALUE obj = stringForceUTF8(arg); VALUE obj = stringForceUTF8(arg);
obj = rb_funcall2(proc, rb_intern("call"), 1, &obj); obj = rb_funcall2(proc, rb_intern("call"), 1, &obj);
return obj; return obj;
} }
@ -184,7 +185,7 @@ RB_METHOD(_marshalLoad)
if (NIL_P(proc)) if (NIL_P(proc))
utf8Proc = rb_proc_new(RUBY_METHOD_FUNC(stringForceUTF8), Qnil); utf8Proc = rb_proc_new(RUBY_METHOD_FUNC(stringForceUTF8), Qnil);
else else
utf8Proc = rb_proc_new(RUBY_METHOD_FUNC(marshal_load_custom_proc), proc); utf8Proc = rb_proc_new(RUBY_METHOD_FUNC(customProc), proc);
VALUE marsh = rb_const_get(rb_cObject, rb_intern("Marshal")); VALUE marsh = rb_const_get(rb_cObject, rb_intern("Marshal"));