aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2020-03-02 11:01:18 -0500
committerJesús <heckyel@hyperbola.info>2020-03-02 11:01:18 -0500
commit30292e8da17c9ef68840a6da23f655a717d7a41f (patch)
treee9877e1202eb2f3cc82f4c95d9fc4f2d1b173db5
parent0c6b88b1e851b3aae7ecaeb909d4fc5b8404679d (diff)
downloadfair-viewer-30292e8da17c9ef68840a6da23f655a717d7a41f.tar.lz
fair-viewer-30292e8da17c9ef68840a6da23f655a717d7a41f.tar.xz
fair-viewer-30292e8da17c9ef68840a6da23f655a717d7a41f.zip
Workaround for List::Util < 1.45
-rwxr-xr-xBuild.PL1
-rwxr-xr-xbin/gtk-fair-viewer8
2 files changed, 8 insertions, 1 deletions
diff --git a/Build.PL b/Build.PL
index ba2b92a..a8c795b 100755
--- a/Build.PL
+++ b/Build.PL
@@ -57,7 +57,6 @@ my $builder = Module::Build->new(
'File::ShareDir' => 0,
'Storable' => 0,
'Digest::MD5' => 0,
- 'List::Util' => 1.43,
)
: (),
},
diff --git a/bin/gtk-fair-viewer b/bin/gtk-fair-viewer
index 2053051..c8ef73b 100755
--- a/bin/gtk-fair-viewer
+++ b/bin/gtk-fair-viewer
@@ -647,6 +647,14 @@ foreach my $path($CONFIG{cache_dir}, $CONFIG{captions_dir}) {
require List::Util;
+ # Workaround for List::Util < 1.45
+ if (!defined(&List::Util::uniq)) {
+ *List::Util::uniq = sub {
+ my %seen;
+ grep { !$seen{$_}++ } @_;
+ };
+ }
+
# Keep only the most recent non-duplicated entries
@history = reverse(List::Util::uniq(reverse(@history)));
@search_history = List::Util::uniq(@search_history);