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

Slow algorithm in Eva::Reset #1073

Open
xezon opened this issue Feb 3, 2024 · 0 comments
Open

Slow algorithm in Eva::Reset #1073

xezon opened this issue Feb 3, 2024 · 0 comments
Labels
investigate Investigation and careful discussion needed optimization

Comments

@xezon
Copy link
Contributor

xezon commented Feb 3, 2024

std::vector<EvaCheck> m_check;

void Eva::Reset()
{
    m_unk2 = 0;
    m_unk1 = 0;

    for (auto it = m_check.begin(); it != m_check.end(); it = m_check.erase(it)) {
    }

    for (int i = 0; i < NUM_EVA_MESSAGES; i++) {
        m_shouldPlay[i] = false;
    }

    m_evaEnabled = true;
}

Ideally vector is cleared like so:

m_check.clear();

Also, should Eva::m_checkInfo perhaps be cleared and its elements deleted on Reset?

@xezon xezon added investigate Investigation and careful discussion needed optimization labels Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigate Investigation and careful discussion needed optimization
Projects
None yet
Development

No branches or pull requests

1 participant