[前][次][番号順一覧][スレッド一覧]

ruby-changes:35965

From: nobu <ko1@a...>
Date: Mon, 20 Oct 2014 14:01:17 +0900 (JST)
Subject: [ruby-changes:35965] nobu:r48046 (trunk): unicode_normalize/normalize.rb: remove prefix

nobu	2014-10-20 14:01:02 +0900 (Mon, 20 Oct 2014)

  New Revision: 48046

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48046

  Log:
    unicode_normalize/normalize.rb: remove prefix
    
    * lib/unicode_normalize/normalize.rb (hangul_decomp_one): remove
      system hungarian prefix, nonsense in ruby.

  Modified files:
    trunk/lib/unicode_normalize/normalize.rb
Index: lib/unicode_normalize/normalize.rb
===================================================================
--- lib/unicode_normalize/normalize.rb	(revision 48045)
+++ lib/unicode_normalize/normalize.rb	(revision 48046)
@@ -43,11 +43,11 @@ module UnicodeNormalize https://github.com/ruby/ruby/blob/trunk/lib/unicode_normalize/normalize.rb#L43
 
   ## Hangul Algorithm
   def self.hangul_decomp_one(target)
-    sIndex = target.ord - SBASE
-    return target if sIndex < 0 || sIndex >= SCOUNT
-    l = LBASE + sIndex / NCOUNT
-    v = VBASE + (sIndex % NCOUNT) / TCOUNT
-    t = TBASE + sIndex % TCOUNT
+    index = target.ord - SBASE
+    return target if index < 0 || index >= SCOUNT
+    l = LBASE + index / NCOUNT
+    v = VBASE + (index % NCOUNT) / TCOUNT
+    t = TBASE + index % TCOUNT
     (t==TBASE ? [l, v] : [l, v, t]).pack('U*') + target[1..-1]
   end
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]