-
Notifications
You must be signed in to change notification settings - Fork 102
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
Use memory mapped files access #1781
base: master
Are you sure you want to change the base?
Conversation
std::vector<std::uint8_t> buf; | ||
|
||
if (!ar->GetFile(fileName, buf) || buf.empty()) { | ||
// use the same buffer to avoid allocation costs for every invocation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this could be static
to the function instead of class member?
#endif | ||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The non-TOOLS path will have two unconditional return
s in a row now, the second one is dead code and may confuse static analysis (or produce warnings etc)
@@ -6,6 +6,7 @@ | |||
#include <vector> | |||
#include <string> | |||
#include <fstream> | |||
#include <memory> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be added to some .cpp file(s) instead? Looks like no new code was added below so probably doesn't need to be in the header (gets applies everywhere the .h is included even if not all .cpp files need it)
Please add it as git submodule, not copy paste code. |
No description provided.