I have a set of strings(ASCII), that i want to assign to a string array(of cap 128).
The position of the string in the array is decided by the ASCII value of the first char of the string.
Like...
strArr := [128]string{}
strA := "A string"
strB := "B string"
strArr[65] = strA // since strA started with 'A' & ASCII('A') = 65
strArr[66] = strB // since strB started with 'B' & ASCII('B') = 66
There is one solution of using utf8.DecodeRuneInString, like ...
r, _ := utf8.DecodeRuneInString(strA)
strArr[r] = strA
Is it possible to time optimise this solution?