[Groonga-commit] groonga/groonga at c5cec39 [master] nfkc: simplify

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Feb 18 23:42:03 JST 2016


Kouhei Sutou	2016-02-18 23:42:03 +0900 (Thu, 18 Feb 2016)

  New Revision: c5cec391330a0e29091859f9aabfb56bdad909bb
  https://github.com/groonga/groonga/commit/c5cec391330a0e29091859f9aabfb56bdad909bb

  Message:
    nfkc: simplify

  Modified files:
    lib/nfkc.rb

  Modified: lib/nfkc.rb (+1 -14)
===================================================================
--- lib/nfkc.rb    2016-02-18 22:38:06 +0900 (cd085d3)
+++ lib/nfkc.rb    2016-02-18 23:42:03 +0900 (bf4fb58)
@@ -281,20 +281,7 @@ class TableGenerator < SwitchGenerator
   def generate_decompose(char_map)
     byte_size_groups = char_map.keys.group_by do |from|
       bytes = from.bytes
-      first_byte = bytes[0]
-      if first_byte < 0x80
-        []
-      elsif first_byte < 0xe0
-        bytes[0, 1]
-      elsif first_byte < 0xf0
-        bytes[0, 2]
-      elsif first_byte < 0xf8
-        bytes[0, 3]
-      elsif first_byte < 0xfc
-        bytes[0, 4]
-      elsif first_byte < 0xfe
-        bytes[0, 5]
-      end
+      bytes[0..-2]
     end
 
     generate_decompose_tables(char_map, byte_size_groups)
-------------- next part --------------
HTML����������������������������...
Descargar 



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