Skip to content

Cannot remove team 0 from TeamsInfoRec. Why? #1215

Open
@xezon

Description

@xezon

Should it have checked m_numTeams < 1 instead?

void TeamsInfoRec::removeTeam(Int i)
{
	if (i < 0 || i >= m_numTeams || m_numTeams <= 1) // <---- ???
		return;

	for ( ; i < m_numTeams-1; i++)
		m_teams[i] = m_teams[i+1];

	for ( ; i < m_numTeamsAllocated; i++)
		m_teams[i].clear();

	--m_numTeams;
}

void TeamsInfoRec::removeTeam(Int i)
{
if (i < 0 || i >= m_numTeams || m_numTeams <= 1)
return;
for ( ; i < m_numTeams-1; i++)
m_teams[i] = m_teams[i+1];
for ( ; i < m_numTeamsAllocated; i++)
m_teams[i].clear();
--m_numTeams;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething is not working right, typically is user facingInvestigateMinorSeverity: Minor < Major < Critical < Blocker

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions