[Groonga-commit] groonga/groonga-normalizer-mysql [master] Remove needless instance variable cache

Back to archive index

Kouhei Sutou null+****@clear*****
Sun Feb 10 19:11:13 JST 2013


Kouhei Sutou	2013-02-10 19:11:13 +0900 (Sun, 10 Feb 2013)

  New Revision: ccc41f00664000f589b4ae042883ee1c610fee15
  https://github.com/groonga/groonga-normalizer-mysql/commit/ccc41f00664000f589b4ae042883ee1c610fee15

  Log:
    Remove needless instance variable cache

  Modified files:
    tool/parser.rb

  Modified: tool/parser.rb (+7 -8)
===================================================================
--- tool/parser.rb    2013-02-10 19:10:32 +0900 (400098d)
+++ tool/parser.rb    2013-02-10 19:11:13 +0900 (e2bd42e)
@@ -88,12 +88,11 @@ class CTypeUCAParser
   def parse(input)
     parse_ctype_uca(input)
     normalize_pages
-    sort_pages
   end
 
   def weight_based_characters
     weight_based_characters = {}
-    @sorted_pages.each do |page, characters|
+    sorted_pages.each do |page, characters|
       characters.each do |character|
         weight = character[:weight]
         weight_based_characters[weight] ||= []
@@ -103,6 +102,12 @@ class CTypeUCAParser
     weight_based_characters
   end
 
+  def sorted_pages
+    @pages.sort_by do |page, characters|
+      page
+    end
+  end
+
   private
   def parse_ctype_uca(input)
     current_page = nil
@@ -153,10 +158,4 @@ class CTypeUCAParser
       end
     end
   end
-
-  def sort_pages
-    @sorted_pages =****@pages*****_by do |page, characters|
-      page
-    end
-  end
 end
-------------- next part --------------
HTML����������������������������...
Download 



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