by chrfrasco · 6y ago · 0 comments
cache := make([]int, len(targetChars)+1)
for i := 0; i < len(targetChars)+1; i++ {
cache[i] = i
}
AFAIK this makes them equivalent (fingers crossed). It seems to not have made much of a difference (-0.03s)1) incorrect if UTF-8-strings are supposed to be valid input, or
2) very inefficient if only ASCII-strings are supposed to be valid input.