about summary refs log tree commit diff
path: root/perl/lib/Nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-08-27T15·28-0400
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-08-27T15·28-0400
commit8b8fe6139e05f990b9d2a35652fd9bdb79189f90 (patch)
tree705277bd75e337c87801c343094134e5b3645a7b /perl/lib/Nix
parentbabe54bf97091441353f2219e7846afd0e0d9f16 (diff)
Drop dependency on List::MoreUtils
Diffstat (limited to 'perl/lib/Nix')
-rw-r--r--perl/lib/Nix/Utils.pm11
1 files changed, 11 insertions, 0 deletions
diff --git a/perl/lib/Nix/Utils.pm b/perl/lib/Nix/Utils.pm
index 943b8dd4abfa..1e7e0b5afb2f 100644
--- a/perl/lib/Nix/Utils.pm
+++ b/perl/lib/Nix/Utils.pm
@@ -6,3 +6,14 @@ sub checkURL {
     my ($url) = @_;
     die "invalid URL ‘$url’\n" unless $url =~ /^ $urlRE $ /x;
 }
+
+sub uniq {
+    my %seen;
+    my @res;
+    foreach my $name (@_) {
+        next if $seen{$name};
+        $seen{$name} = 1;
+        push @res, $name;
+    }
+    return @res;
+}