implement minor improvements in existing code#91
Open
mick-lue wants to merge 2 commits intoModOrganizer2:masterfrom
Open
implement minor improvements in existing code#91mick-lue wants to merge 2 commits intoModOrganizer2:masterfrom
mick-lue wants to merge 2 commits intoModOrganizer2:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Going through the code, I encountered a few instances where minor improvements can be made.
tree_container.h
std::formatavoids creating temporary strings that then get concatenated, allowing the compiler to do in-place string construction.winapi
createPath.ttrampolinepool.cpp
buffers.empty()can be more efficient than comparing tobuffers.size()depending on the implementation of size() and makes the code easier to understand!m_ThreadGuards->contains(func)makes the code easier to understandhookmanager.cpp
maptracker.h
createFakePathascreatePathstd::movewhen returning a local variable prevents the compiler from doing copy elision optimizations here. Without it, the compiler can potentially further optimize the function.usvfs.cpp
RedirectionTree::existsaccepts a string_view there is no need to transform the iterator string to a c_str.Tests
All tests still pass and I've had no issues using MO2, starting programs or games through MO2 and playing heavily-modded skyrirm for example.