News for hackers. Stuff that matters.
Re:Removing Array Duplicates by rndgermandude on Friday April 12, 2019 @09:00PM (#19650384)
Don't calculate strings.ToLower() twice and skip over s == "" to avoid the map lookups and some assignments when already tombstoned and you'll save a lot of time.

    seen := make(map[string]bool)
    for n, s := range array {
        if s == "" {
            continue
        }
        lower := strings.ToLower(s)
        if seen[lower] {
            array[n] = ""
        } else {
            seen[lower] = true
        }
    }
Re:Removing Array Duplicates by minitech on Saturday April 13, 2019 @08:54AM (#19652739)
How can an element be already tombstoned? Isn’t that the first loop, making only one pass?