Skip to content
Browse files

remove some janky, unnecessary type checks

  • Loading branch information...
1 parent c2e593c commit 7d506882bf3ca6961737e8e2b802fceecf9f7176 @jmhodges committed Dec 2, 2012
Showing with 0 additions and 3 deletions.
  1. +0 −1 lib/rchardet/chardistribution.rb
  2. +0 −2 lib/rchardet/jpcntx.rb
View
1 lib/rchardet/chardistribution.rb
@@ -198,7 +198,6 @@ def get_order(aStr)
# first byte range: 0x81 -- 0x9f , 0xe0 -- 0xfe
# second byte range: 0x40 -- 0x7e, 0x81 -- oxfe
# no validation needed here. State machine has done that
- aStr = aStr[0, 2].join if aStr.class == Array
if (aStr[0, 1] >= "\x81") and (aStr[0, 1] <= "\x9F")
order = 188 * (aStr[0] - 0x81)
elsif (aStr[0, 1] >= "\xE0") and (aStr[0, 1] <= "\xEF")
View
2 lib/rchardet/jpcntx.rb
@@ -186,7 +186,6 @@ class SJISContextAnalysis < JapaneseContextAnalysis
def get_order(aStr)
return -1, 1 if not aStr
# find out current char's byte length
- aStr = aStr[0, 2].join if aStr.class == Array
first = aStr[0, 1]
if ((first >= "\x81") and (first <= "\x9F")) or ((first >= "\xE0") and (first <= "\xFC"))
charLen = 2
@@ -209,7 +208,6 @@ class EUCJPContextAnalysis < JapaneseContextAnalysis
def get_order(aStr)
return -1, 1 unless aStr
# find out current char's byte length
- aStr = aStr[0, 2].join if aStr.class == Array
first = aStr[0, 1]
if (first == "\x8E") or ((first >= "\xA1") and (first <= "\xFE"))
charLen = 2

0 comments on commit 7d50688

Please sign in to comment.
Something went wrong with that request. Please try again.