[project @ 2003-09-23 13:23:58 by simonmar]
authorsimonmar <unknown>
Tue, 23 Sep 2003 13:23:58 +0000 (13:23 +0000)
committersimonmar <unknown>
Tue, 23 Sep 2003 13:23:58 +0000 (13:23 +0000)
micro-optimisation

libraries/base/GHC/Handle.hs

index 941d2e2..d1f026c 100644 (file)
@@ -441,7 +441,8 @@ flushReadBuffer fd buf
      return buf{ bufWPtr=0, bufRPtr=0 }
 
 flushWriteBuffer :: FD -> Bool -> Buffer -> IO Buffer
-flushWriteBuffer fd is_stream buf@Buffer{ bufBuf=b, bufRPtr=r, bufWPtr=w }  = do
+flushWriteBuffer fd is_stream buf@Buffer{ bufBuf=b, bufRPtr=r, bufWPtr=w }  =
+  seq fd $ do -- strictness hack
   let bytes = w - r
 #ifdef DEBUG_DUMP
   puts ("flushWriteBuffer, fd=" ++ show fd ++ ", bytes=" ++ show bytes ++ "\n")