Tiny optimization to create less copies:
    
    
    proc makeSignature(word: string): string =
      let ascii = unidecode(word)
      result = strutils.toLowerAscii(ascii)
      result.sort(lower, system.cmp) # or algorithm.sort(result, lower, 
system.cmp)
    
    
    Run

Note that there is also the [strtabs](https://nim-lang.org/docs/strtabs.html) 
module for efficient tables of strings to strings and case insensitivity.

Reply via email to