Optimize string tag length calculations in regionSwab()