module Etcenv::Utils

Public Class Methods

uniq_with_keeping_first_appearance(array) click to toggle source
# File lib/etcenv/utils.rb, line 4
def uniq_with_keeping_first_appearance(array)
  set = {}
  result = []
  array.each do |x|
    next if set[x]
    result.push x
    set[x] = true
  end
  result
end