repo.or.cz
/
koha.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Bug 23828: Elasticsearch - Preserve record order when combining subfield in mappings
[koha.git]
/
Koha
/
MoreUtils.pm
blob
02751111ff5c63934334ce1ed9f123f002eb7fc4
1
package
Koha
::
MoreUtils
;
2
3
use
Modern
::
Perl
;
4
5
# From List::MoreUtils v4.0
6
sub
singleton
{
7
my
%seen
= ();
8
my
$k
;
9
my
$seen_undef
;
10
grep
{
1
== (
defined
$_
?
$seen
{
$k
=
$_
} :
$seen_undef
) }
11
grep
{
defined
$_
?
not
$seen
{
$k
=
$_
}++ :
not
$seen_undef
++ }
@_
;
12
}
13
14
1
;