Slight homoglyph search optimization
Instead of calling Find twice, it calls it once for the first character and checks if the returned group contains the other character
This commit is contained in:
@@ -1830,7 +1830,8 @@ namespace Barotrauma
|
||||
for (int i=0;i<a.Length;i++)
|
||||
{
|
||||
if (a[i] == b[i]) continue;
|
||||
if (homoglyphs.Find(g => g.Contains((uint)a[i])) != homoglyphs.Find(g => g.Contains((uint)b[i]))) return false;
|
||||
uint[] glyphGroup = homoglyphs.Find(g => g.Contains((uint)a[i]));
|
||||
if (glyphGroup==null || !glyphGroup.Contains((uint)b[i])) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user