TotalWar-Modding / tw_pack_lib

1 stars 0 forks source link

Implemented `load_data` function, like the get data one but just does… #14

Closed Frodo45127 closed 5 years ago

Frodo45127 commented 5 years ago

… the loading to memory part.

It's useful for when we don't need the loaded data, we just need it to be loaded. The function is a reduced version of the get_data without dealing with data that's already in memory and without returning anything.

An alternative is to make the get_data return a Result<Option<Arc<Vec<u8>>>> but that will complicate it even more, as we'll have to deal with and error and a some/none instead just an error.

Either way, it'll be good to have something like this, as it can allow to speed up a bit the "loading to memory" part as we will not receive data that'll be dropped immediately.