lib/benchmarks/enumerable.rb
def uniq_map
    each_with_object([]) { |item, acc|
      result = yield(item)
      acc << result if acc.exclude?(result)
    }
  end
# Map but don't collect duplicate result values.
Map but don't collect duplicate result values.
Map but don ' t collect duplicate result values .
def uniq_map
    each_with_object([]) { |item, acc|
      result = yield(item)
      acc << result if acc.exclude?(result)
    }
  end
def uniq_map each_with_object ( [ ] ) { | item , acc | result = yield ( item ) acc << result if acc . exclude? ( result ) } end
Map but don't collect duplicate result values.
Map but don ' t collect duplicate result values .