-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deduplicate files #158
Comments
I think the original intention was for users to keep track of the |
Well, I could be including the same file more than once, if this wasn't part of codespan I'd have to implement it myself. e.g.
#include <stdio.h>
#include <limits.h>
|
Now that the Files trait exists as of #164 users should be implement their own solutions and decide if they need deduplication or not, but I agree that supporting single file use cases would be very nice (especially for A bit unrelated, but I think it would be better if it was in the |
I'm going to say that this should be handled in a custom implementation of For users of |
Currently, calling Files.add(name, file) twice in a row will duplicate the entire file, wasting memory. It would be nice to deduplicate by only storing the file once. This could be done by storing a HashMap<name, FileID> which returns the id if the file already exists.
This would mean that users can no longer add two different files with the same name, but I think that's fine as long as it's documented.
The text was updated successfully, but these errors were encountered: