Simplify characterCode lookup

Reduce String.fromCharCode that can’t be optimized by the minifier.
Combine single path conditional
Remove unused variable

It is only set to empty then passed
Merge pull request #2071 from nschonni/autocomplete-js-cleaning

Autocomplete js cleaning