make suggestions given by hlint
This commit is contained in:
parent
9bc616ccf5
commit
35856c20a3
1 changed files with 3 additions and 6 deletions
|
@ -440,8 +440,7 @@ find c col sel = query c col [] 0 0 sel []
|
||||||
findOne :: Connection -> FullCollection -> Selector -> IO (Maybe BsonDoc)
|
findOne :: Connection -> FullCollection -> Selector -> IO (Maybe BsonDoc)
|
||||||
findOne c col sel = do
|
findOne c col sel = do
|
||||||
cur <- query c col [] 0 (-1) sel []
|
cur <- query c col [] 0 (-1) sel []
|
||||||
el <- nextDoc cur
|
nextDoc cur
|
||||||
return el
|
|
||||||
|
|
||||||
-- | Perform a query and return the result as a lazy list. Be sure to
|
-- | Perform a query and return the result as a lazy list. Be sure to
|
||||||
-- understand the comments about using the lazy list given for
|
-- understand the comments about using the lazy list given for
|
||||||
|
@ -628,9 +627,7 @@ finish :: Cursor -> IO ()
|
||||||
finish cur = do
|
finish cur = do
|
||||||
let h = cHandle $ curCon cur
|
let h = cHandle $ curCon cur
|
||||||
cid <- readIORef $ curID cur
|
cid <- readIORef $ curID cur
|
||||||
if cid == 0
|
unless (cid == 0) $ do
|
||||||
then return ()
|
|
||||||
else do
|
|
||||||
let body = runPut $ do
|
let body = runPut $ do
|
||||||
putI32 0
|
putI32 0
|
||||||
putI32 1
|
putI32 1
|
||||||
|
@ -638,7 +635,7 @@ finish cur = do
|
||||||
(_reqID, msg) <- packMsg (curCon cur) OPKillCursors body
|
(_reqID, msg) <- packMsg (curCon cur) OPKillCursors body
|
||||||
L.hPut h msg
|
L.hPut h msg
|
||||||
writeIORef (curClosed cur) True
|
writeIORef (curClosed cur) True
|
||||||
return ()
|
return ()
|
||||||
|
|
||||||
-- | The field key to index on.
|
-- | The field key to index on.
|
||||||
type Key = L8.ByteString
|
type Key = L8.ByteString
|
||||||
|
|
Loading…
Reference in a new issue