blixt / py-starbound

Python package for working with Starbound files.
MIT License
104 stars 22 forks source link

Use tell/seek to allow the user to read from the database inside a get_all_keys loop #41

Closed apocalyptech closed 6 years ago

apocalyptech commented 6 years ago

Bah, apologies for the noise here - I realized I was being stupid about the tell/seek thing. It doesn't matter that LeafReader can't deal with moving the file position around, because we can just operate on the base stream itself. So this brings it back to just doing a direct yield without any temp lists.

blixt commented 6 years ago

You’re absolutely right! In fact this almost seems like something LeafReader could do internally for developer friendliness and avoiding subtle bugs, but I would think about that for a bit. I’ve got a busy morning so I’ll merge this later. Thanks for this!