[Groonga-commit] groonga/groonga at 9100522 [master] mrb: add workaround for mruby bug

アーカイブの一覧に戻る

Kouhei Sutou null+****@clear*****
Mon Feb 23 13:12:57 JST 2015


Kouhei Sutou	2015-02-23 13:12:57 +0900 (Mon, 23 Feb 2015)

  New Revision: 9100522bffefbffc59d4d65b88b4cc4466258717
  https://github.com/groonga/groonga/commit/9100522bffefbffc59d4d65b88b4cc4466258717

  Message:
    mrb: add workaround for mruby bug
    
    The following script reproduces the bug:
    
        x = if false
              1
            else
              case :xxx
              when :yyy
              end
              2
            end
        p x # => nil not 1

  Modified files:
    lib/mrb/scripts/expression_size_estimator.rb

  Modified: lib/mrb/scripts/expression_size_estimator.rb (+4 -3)
===================================================================
--- lib/mrb/scripts/expression_size_estimator.rb    2015-02-23 11:57:18 +0900 (f66f02a)
+++ lib/mrb/scripts/expression_size_estimator.rb    2015-02-23 13:12:57 +0900 (a8ac4f8)
@@ -12,10 +12,10 @@ module Groonga
 
       sizes = data_list.collect do |data|
         search_index = data.search_indexes.first
+        size = nil
         if search_index.nil?
-          @table.size
+          size =****@table*****
         else
-          size = nil
           case data.op
           when Operator::MATCH
             size = estimate_match(data, search_index)
@@ -32,8 +32,9 @@ module Groonga
               size = estimate_between(data, search_index)
             end
           end
-          size || @table.size
+          size ||=****@table*****
         end
+        size
       end
       sizes.min
     end
-------------- next part --------------
HTML����������������������������...
ダウンロード 



More information about the Groonga-commit mailing list
アーカイブの一覧に戻る