From: Mario Date: Sun, 21 Oct 2018 17:06:58 +0000 (+1000) Subject: Optimize the redundancy check and ignore color codes (they're stripped anyway) X-Git-Tag: xonotic-v0.8.5~1750^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=bf6214036d957dcc71a005ec5de8bbf92eec91a9;p=xonotic%2Fxonotic-data.pk3dir.git Optimize the redundancy check and ignore color codes (they're stripped anyway) --- diff --git a/qcsrc/common/mapinfo.qc b/qcsrc/common/mapinfo.qc index 62e03d21b..68c548aae 100644 --- a/qcsrc/common/mapinfo.qc +++ b/qcsrc/common/mapinfo.qc @@ -724,23 +724,19 @@ void _MapInfo_Parse_Settemp(string pFilename, string acl, float type, string s, float MapInfo_isRedundant(string fn, string t) { // normalize file name - fn = strreplace("_", "-", fn); + fn = strreplace("_", "", fn); + fn = strreplace("-", "", fn); // normalize visible title - t = strreplace(": ", "-", t); - t = strreplace(":", "-", t); - t = strreplace(" ", "-", t); - t = strreplace("_", "-", t); - t = strreplace("'", "-", t); - - if(!strcasecmp(fn, t)) - return true; + t = strreplace(":", "", t); + t = strreplace(" ", "", t); + t = strreplace("_", "", t); + t = strreplace("-", "", t); + t = strreplace("'", "", t); + t = strdecolorize(t); // we allow the visible title to have punctuation the file name does // not, but not vice versa - t = strreplace("-", "", t); - fn = strreplace("-", "", fn); - if(!strcasecmp(fn, t)) return true;