From a25c50361a0ca55962e7f2f979a0fca515dc7f06 Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Sat, 9 Aug 2014 05:17:35 -0700 Subject: Added optimization note. --- upb/bindings/ruby/upb.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'upb') diff --git a/upb/bindings/ruby/upb.c b/upb/bindings/ruby/upb.c index 936baef..0d25610 100644 --- a/upb/bindings/ruby/upb.c +++ b/upb/bindings/ruby/upb.c @@ -245,6 +245,8 @@ static VALUE msg_accessor(int argc, VALUE *argv, VALUE obj) { // method_missing protocol: (method [, arg1, arg2, ...]) assert(argc >= 1 && SYMBOL_P(argv[0])); + // OPT(haberman): find a better way to get the method name. + // This is allocating a new string each time, which should not be necessary. VALUE method = rb_id2str(SYM2ID(argv[0])); const char *method_str = RSTRING_PTR(method); size_t method_len = RSTRING_LEN(method); -- cgit v1.2.3