-
-
Notifications
You must be signed in to change notification settings - Fork 429
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
Band-aid for Bulk SDKHooks performance impact #2092
Conversation
Resolves partially: #1935 There shouldn't be any issues. Potential adjustments could include storing hook information and unhooking on map end although it's not necessary. Original work by #1935 (comment)
Just remove the code or make it platform dependent.(Not commenting on the validity of the change but commented code is a style/readability problem)
|
Gotcha. As for making code platform dependent, I believe it would complicate things unnecessarily and would serve no functional benefit in this case! |
If the issue is limited to one platform, and this is a "bandaid" fix, scope could probably be limited. KyleS mentioned us resetting the table on levelend, seems that's missing here |
std::vector<CVTableList *> &vtablehooklist = g_HookList[type]; | ||
for (size_t listentry = 0; listentry < vtablehooklist.size(); ++listentry) | ||
{ | ||
std::vector<HookList> &pawnhooks = vtablehooklist[listentry]->hooks; |
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.
there should be a zap function or something to just clear the vector.
entry--; | ||
} | ||
|
||
if (pawnhooks.size() == 0) |
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.
not needed.
if (pawnhooks.size() == 0) | ||
{ | ||
delete vtablehooklist[listentry]; | ||
vtablehooklist.erase(vtablehooklist.begin() + listentry); |
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.
ditto on zap / clear, can happen at the end outside of the loop.
Resolves #1935
Original solution found by #1935 (comment)