]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - Network/HTTP/Lucu/HttpVersion.hs
Slight speed improvement
[Lucu.git] / Network / HTTP / Lucu / HttpVersion.hs
index e1ed0f38024fd9836629c84eee5d9bef20fd46cc..bd904e8c58b21bf5526620ffb1473d0d6f2af523 100644 (file)
@@ -32,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 ()