[reg] fix Issue 13193 - Extreme slowdown in compilation time of OpenSSL in Tango for optimized build

https://issues.dlang.org/show_bug.cgi?id=13193

Turned an O(n*n) algorithm into O(n)