[Groonga-commit] ranguba/rroonga at c9665a0 [master] Reduce allocated objects

Back to archive index

Kouhei Sutou null+****@clear*****
Sat Mar 5 22:55:37 JST 2016


Kouhei Sutou	2016-03-05 22:55:37 +0900 (Sat, 05 Mar 2016)

  New Revision: c9665a0a5f994d663e3c93a8bfcdf552d7a54a53
  https://github.com/ranguba/rroonga/commit/c9665a0a5f994d663e3c93a8bfcdf552d7a54a53

  Message:
    Reduce allocated objects

  Modified files:
    ext/groonga/rb-grn-config.c

  Modified: ext/groonga/rb-grn-config.c (+2 -6)
===================================================================
--- ext/groonga/rb-grn-config.c    2016-03-05 22:54:42 +0900 (66e3517)
+++ ext/groonga/rb-grn-config.c    2016-03-05 22:55:37 +0900 (e3dbd98)
@@ -204,18 +204,14 @@ rb_grn_config_each (VALUE self)
         uint32_t key_size;
         const char *value;
         uint32_t value_size;
-        VALUE rb_key, rb_value, rb_key_value;
+        VALUE rb_key, rb_value;
 
         key_size = grn_config_cursor_get_key(context, cursor, &key);
         rb_key = rb_str_new(key, key_size);
         value_size = grn_config_cursor_get_value(context, cursor, &value);
         rb_value = rb_str_new(value, value_size);
 
-        rb_key_value = rb_ary_new();
-        rb_ary_push(rb_key_value, rb_key);
-        rb_ary_push(rb_key_value, rb_value);
-
-        rb_yield(rb_key_value);
+        rb_yield_values(2, rb_key, rb_value);
     }
 
     return Qnil;
-------------- next part --------------
HTML����������������������������...
Descargar 



More information about the Groonga-commit mailing list
Back to archive index