Skip to content

Conversation

@glaslos
Copy link

@glaslos glaslos commented Apr 4, 2023

Addressing #8
Benchmark suffers by about 12% iterations on my machine.

Copy link
Owner

@mozillazg mozillazg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! I added some comments.

textSlice := flag.Args()
stdin := []byte{}
if !isatty.IsTerminal(os.Stdin.Fd()) {
if !isTerminal(os.Stdin.Fd()) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need github.com/mattn/go-isatty to support mac os and windows.

// e.g. Unidecode("kožušček") => "kozuscek"
func Unidecode(s string) string {
return unidecode(s)
return strings.Trim(unidecode(s), " ")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens when the s is kožušček ? Does it return an unexpected kozuscek?

IMHO, letting the caller do the trim work is more simple.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants