Create a copy of the iterator before turning it into a stream

A functional language shouldn't modify the iterator, but instead keep
advancing. As we can't stop in any particular point, we still just use
a stream.
This commit is contained in:
Carlos Martín Nieto
2013-08-12 13:38:33 +02:00
parent 4c63c08c50
commit bd83f2fb0e
3 changed files with 17 additions and 7 deletions

View File

@@ -44,7 +44,7 @@ lookup(Repo, Refname) ->
iterator(Repo, Regexp) ->
case geef_repo:iterator(Repo, Regexp) of
{ok, Handle} ->
{ok, #geef_iterator{type=ref, handle=Handle}};
{ok, #geef_iterator{type=ref, repo=Repo, regexp=Regexp, handle=Handle}};
Other ->
Other
end.