]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - Network/HTTP/Lucu/HttpVersion.hs
Slight speed improvement
[Lucu.git] / Network / HTTP / Lucu / HttpVersion.hs
index 15ead365cdf6403a2e53eece4dbc117a1c8dcfef..bd904e8c58b21bf5526620ffb1473d0d6f2af523 100644 (file)
@@ -8,8 +8,6 @@ module Network.HTTP.Lucu.HttpVersion
     )
     where
 
-import qualified Data.ByteString.Lazy.Char8 as B
-import           Data.ByteString.Lazy.Char8 (ByteString)
 import           Network.HTTP.Lucu.Parser
 import           System.IO
 
@@ -34,7 +32,11 @@ httpVersionP = do string "HTTP/"
                   major <- many1 digit
                   char '.'
                   minor <- many1 digit
-                  return $ HttpVersion (read major) (read minor)
+                  return $ HttpVersion (read' major) (read' minor)
+    where
+      read' "1" = 1 -- この二つが
+      read' "0" = 0 -- 壓倒的に頻出する
+      read' s   = read s
 
 
 hPutHttpVersion :: Handle -> HttpVersion -> IO ()