Skip to content

Commit

Permalink
clean up code
Browse files Browse the repository at this point in the history
  • Loading branch information
mozillazg committed Jul 14, 2016
1 parent 9e111c4 commit fea5379
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions unidecode.go
Expand Up @@ -19,9 +19,8 @@ func Unidecode(s string) string {
}

func unidecode(s string) string {
runes := []rune(s)
ret := []string{}
for _, r := range runes {
for _, r := range s {
if r < unicode.MaxASCII {
v := string(r)
ret = append(ret, v)
Expand All @@ -33,7 +32,6 @@ func unidecode(s string) string {

section := r >> 8 // Chop off the last two hex digits
position := r % 256 // Last two hex digits

if tb, ok := table.Tables[section]; ok {
if len(tb) > int(position) {
ret = append(ret, tb[position])
Expand Down

0 comments on commit fea5379

Please sign in to comment.