Permalink
Browse files

Make readIndex lazier. This gives more than 10x performance for most …

…operations.
  • Loading branch information...
1 parent 5078263 commit a8b2ad33ad4d41a062adbec6b73f0768498a8b92 @kolmodin kolmodin committed Aug 19, 2007
Showing with 3 additions and 3 deletions.
  1. +3 −3 Index.hs
View
@@ -21,9 +21,9 @@ readIndex str = do
entr <- archiveEntries untared
case splitDirectories (tarFileName (entryHeader entr)) of
[".",pkgname,vers,file] -> do
- descr <- case parseDescription (unpack (entryData entr)) of
- ParseOk _ descr -> return descr
- _ -> error $ "Couldn't read cabal file "++show file
+ let descr = case parseDescription (unpack (entryData entr)) of
+ ParseOk _ descr -> descr
+ _ -> error $ "Couldn't read cabal file "++show file
return (pkgname,vers,descr)
_ -> fail "doesn't look like the proper path"

0 comments on commit a8b2ad3

Please sign in to comment.