Skip to content
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

21364: Improves entity persistence: works as single transactional files as well as performance improvements, MINOR #315

Open
wants to merge 52 commits into
base: main
Choose a base branch
from

Conversation

howsohazard
Copy link
Contributor

No description provided.

@howsohazard howsohazard requested a review from a team as a code owner December 2, 2024 04:45
src/Amalgam/AssetManager.cpp Outdated Show resolved Hide resolved
std::array<char, 201> buffer;
file.read(buffer.data(), 200);
buffer[200] = '\0';
std::string str(buffer.data(), 200);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this code be split out into a helper function? (I think the byte-level char array manipulation should be sketchy in modern C++ but can't immediately find an alternative, and it's easier to justify in comments just once.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's in two spots really close to each other, each of which needs its own regular expression. I could merge the methods, but don't know if that's better.

}
}

EvaluableNodeReference AssetManager::LoadResource(AssetParameters *asset_params, EvaluableNodeManager *enm,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be AssetParameters &asset_params (a reference and not a pointer) so that you don't have to change all of the uses of it? (Do you ever reassign which AssetParameters it is?). Should it be a const &? (Does the code ever change the parameters, or just read them?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If only you saw how many times I switch back and forth between passing as a reference and as a pointer in this work :-). Many of the other methods do use shared pointers. I could make two of the methods LoadResource and StoreResource work on AssetParams as a reference, but they'd be inconsistent with the rest that deal with pointers or shared pointers. Would changing just those two be preferable?

src/Amalgam/AssetManager.cpp Show resolved Hide resolved
src/Amalgam/BinaryPacking.h Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants