[Groonga-commit] ranguba/rroonga at 09594f6 [master] Use RB_GRN_INTERN() for C string -> Ruby's symbol

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Sep 29 22:09:51 JST 2014


Kouhei Sutou	2014-09-29 22:09:51 +0900 (Mon, 29 Sep 2014)

  New Revision: 09594f6530cddeaf855d664d5241128069c2774d
  https://github.com/ranguba/rroonga/commit/09594f6530cddeaf855d664d5241128069c2774d

  Message:
    Use RB_GRN_INTERN() for C string -> Ruby's symbol

  Modified files:
    ext/groonga/rb-grn-posting.c
    ext/groonga/rb-grn-variable-size-column.c

  Modified: ext/groonga/rb-grn-posting.c (+4 -4)
===================================================================
--- ext/groonga/rb-grn-posting.c    2014-09-29 21:56:13 +0900 (90ad08e)
+++ ext/groonga/rb-grn-posting.c    2014-09-29 22:09:51 +0900 (d88a094)
@@ -1,7 +1,7 @@
 /* -*- coding: utf-8; mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /*
   Copyright (C) 2011  Haruka Yoshihara <yoshihara �� clear-code.com>
-  Copyright (C) 2012  Kouhei Sutou <kou �� clear-code.com>
+  Copyright (C) 2012-2014  Kouhei Sutou <kou �� clear-code.com>
 
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
@@ -30,7 +30,7 @@ rb_grn_posting_new (grn_posting *posting, grn_id term_id,
     parameters = rb_hash_new();
 
 #define SET_PARAMETER(key, value) \
-    rb_hash_aset(parameters, (rb_str_intern(rb_str_new2((key)))), INT2NUM((value)))
+    rb_hash_aset(parameters, RB_GRN_INTERN(key), INT2NUM((value)))
 
     SET_PARAMETER("record_id", posting->rid);
     SET_PARAMETER("section_id", posting->sid);
@@ -42,8 +42,8 @@ rb_grn_posting_new (grn_posting *posting, grn_id term_id,
 
 #undef SET_PARAMETER
 
-    rb_hash_aset(parameters, rb_str_intern(rb_str_new2("table")), rb_table);
-    rb_hash_aset(parameters, rb_str_intern(rb_str_new2("lexicon")), rb_lexicon);
+    rb_hash_aset(parameters, RB_GRN_INTERN("table"), rb_table);
+    rb_hash_aset(parameters, RB_GRN_INTERN("lexicon"), rb_lexicon);
 
     return rb_funcall(rb_cGrnPosting, rb_intern("new"), 1,
                       parameters);

  Modified: ext/groonga/rb-grn-variable-size-column.c (+2 -2)
===================================================================
--- ext/groonga/rb-grn-variable-size-column.c    2014-09-29 21:56:13 +0900 (a2bc68e)
+++ ext/groonga/rb-grn-variable-size-column.c    2014-09-29 22:09:51 +0900 (1bd161f)
@@ -210,10 +210,10 @@ rb_grn_variable_size_column_array_reference (VALUE self, VALUE rb_id)
 
         rb_element = rb_hash_new();
         rb_hash_aset(rb_element,
-                     rb_str_intern(rb_str_new2("value")),
+                     RB_GRN_INTERN("value"),
                      rb_element_value);
         rb_hash_aset(rb_element,
-                     rb_str_intern(rb_str_new2("weight")),
+                     RB_GRN_INTERN("weight"),
                      UINT2NUM(weight));
 
         rb_ary_push(rb_value, rb_element);
-------------- next part --------------
HTML����������������������������...
Download 



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