From 04087dd0b14743b063c9bfa95cceb94687925db5 Mon Sep 17 00:00:00 2001 From: hikerstk Date: Fri, 4 Nov 2011 10:57:30 +0000 Subject: [PATCH] Simplified function by removing duplicated code. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10105 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/tracks/track_manager.cpp | 42 +++++++++++++----------------------- 1 file changed, 15 insertions(+), 27 deletions(-) diff --git a/src/tracks/track_manager.cpp b/src/tracks/track_manager.cpp index 5628878d1..0b87cb415 100644 --- a/src/tracks/track_manager.cpp +++ b/src/tracks/track_manager.cpp @@ -190,8 +190,8 @@ void TrackManager::removeTrack(const std::string &ident) Group2Indices &group_2_indices = track->isArena() ? m_arena_groups : m_track_groups; std::vector &group_names = track->isArena() - ? m_arena_group_names - : m_track_group_names; + ? m_arena_group_names + : m_track_group_names; const std::vector& groups=track->getGroups(); for(unsigned int i=0; i& new_groups = track->getGroups(); - const bool isArena = track->isArena(); - + const std::vector& new_groups = track->getGroups(); + + Group2Indices &group_2_indices = track->isArena() ? m_arena_groups + : m_track_groups; + std::vector &group_names = track->isArena() + ? m_arena_group_names + : m_track_group_names; + const unsigned int groups_amount = new_groups.size(); for(unsigned int i=0; i