Skip to content

Slow algorithm in Eva::Reset #1073

Open
@xezon

Description

@xezon
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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions