internal distinct_impl gains a second argument. #97