TheAssemblyArmada / Thyme

An open source re-implementation of Generals : Zero Hour written in C++.
GNU General Public License v2.0
585 stars 59 forks source link

Optimization in MapCache::Load_User_Maps #1033

Open xezon opened 11 months ago

xezon commented 11 months ago
bool MapCache::Load_User_Maps()
{
...
                    if (g_theFileSystem->Get_File_Info(map_path, &info)) {
                        char dest[PATH_MAX];
                        strcpy(dest, map_path.Str());

                        for (const char *c = dest; *c != '\0'; c++) {
                            if (*c == '\\' || *c == '/') {
                                c++;
                            }
                        }

                        m_seen[map_path] = true;
                        map_added |= Add_Map(map_root, *it, &info, g_theWriteableGlobalData->m_buildMapCache);
                    } else {
                        captainslog_dbgassert(false, "Could not get file info for map %s", (*it).Str());
                    }
...
}

The for loop does nothing. Can be removed.