From bf6214036d957dcc71a005ec5de8bbf92eec91a9 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 22 Oct 2018 03:06:58 +1000 Subject: [PATCH] Optimize the redundancy check and ignore color codes (they're stripped anyway) --- qcsrc/common/mapinfo.qc | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) 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; -- 2.39.2