Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
b48f916c
Commit
b48f916c
authored
Dec 21, 2015
by
Edsko de Vries
Browse files
Make sure 'tarEntriesList' does not create thunks
parent
42ab5ea5
Changes
1
Hide whitespace changes
Inline
Side-by-side
cabal-install/Distribution/Client/IndexUtils.hs
View file @
b48f916c
{-# LANGUAGE CPP #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE BangPatterns #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Client.IndexUtils
...
...
@@ -286,9 +287,9 @@ parsePackageIndex = concatMap (uncurry extract) . tarEntriesList . Tar.read
tarEntriesList
::
Tar
.
Entries
->
[(
BlockNo
,
Tar
.
Entry
)]
tarEntriesList
=
go
0
where
go
_
Tar
.
Done
=
[]
go
_
(
Tar
.
Fail
e
)
=
error
(
"tarEntriesList: "
++
e
)
go
n
(
Tar
.
Next
e
es'
)
=
(
n
,
e
)
:
go
(
n
+
Tar
.
entrySizeInBlocks
e
)
es'
go
!
_
Tar
.
Done
=
[]
go
!
_
(
Tar
.
Fail
e
)
=
error
(
"tarEntriesList: "
++
e
)
go
!
n
(
Tar
.
Next
e
es'
)
=
(
n
,
e
)
:
go
(
n
+
Tar
.
entrySizeInBlocks
e
)
es'
extractPkg
::
Tar
.
Entry
->
BlockNo
->
Maybe
(
IO
(
Maybe
PackageEntry
))
extractPkg
entry
blockNo
=
case
Tar
.
entryContent
entry
of
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment