gameServer/Utils.hs
changeset 8396 5123eac2f9d6
parent 7862 bd76ca40db68
child 8401 87410ae372f6
--- a/gameServer/Utils.hs	Thu Jan 17 18:12:30 2013 +0100
+++ b/gameServer/Utils.hs	Thu Jan 17 23:17:39 2013 +0400
@@ -118,10 +118,10 @@
 cutHost = B.intercalate "." .  flip (++) ["*","*"] . List.take 2 . B.split '.'
 
 caseInsensitiveCompare :: B.ByteString -> B.ByteString -> Bool
-caseInsensitiveCompare a b = f a == f b
-    where
-        f = map Char.toUpper . UTF8.toString
+caseInsensitiveCompare a b = upperCase a == upperCase b
 
+upperCase :: B.ByteString -> B.ByteString
+upperCase = UTF8.fromString . map Char.toUpper . UTF8.toString
 
 roomInfo :: B.ByteString -> RoomInfo -> [B.ByteString]
 roomInfo n r = [