About
History
New snippet →
Upload snippet →
Snippet #2769 (by Ekleog, python)
#2769
Expires in: 0 minutes
View Raw
diff
--
git
a
/
lib
/
lists
.
nix
b
/
lib
/
lists
.
nix
index
9
f2ccc00caf
.
.30
d87ece664
100644
---
a
/
lib
/
lists
.
nix
+++
b
/
lib
/
lists
.
nix
@@
-
633
,
8
+
633
,
7
@@
rec
{
else
let
x
=
head
list
;
-
xs
=
unique
(
drop
1
list
);
-
in
[
x
]
++
remove
x
xs
;
+
in
[
x
]
++
unique
(
remove
x
list
);
/*
Intersects
list
'e'
and
another
list
.
O
(
nm
)
complexity
.
Wrap long lines
Reply to this snippet →
Honeypot, don't fill.
diff --git a/lib/lists.nix b/lib/lists.nix index 9f2ccc00caf..30d87ece664 100644 --- a/lib/lists.nix +++ b/lib/lists.nix @@ -633,8 +633,7 @@ rec { else let x = head list; - xs = unique (drop 1 list); - in [x] ++ remove x xs; + in [x] ++ unique (remove x list); /* Intersects list 'e' and another list. O(nm) complexity.
Text (preformatted)
Text (not code)
----------
ABAP
ApacheConf
AppleScript
ActionScript
Bash
BBCode
C
Clojure
COBOL
CSS
CUDA
Dart
Delphi
Diff
Django
Erlang
Fortran
Go
Groovy
Haml
Haskell
HTML
HTTP
INI
IRC
Java
JavaScript
JSON
Lua
Makefile
Mako
Mason
Matlab
Modula
Monkey
MySQL
NumPy
OCaml
Perl
PHP
PostScript
PowerShell
Prolog
Properties
Puppet
Python
Ruby
reStructuredText
Rust
Sass
Scala
Scheme
Scilab
SCSS
Smalltalk
Smarty
SQL
Tcl
Tcsh
TeX
Text (Preformatted)
Text (non-code)
VB.net
VimL
XML
XQuery
XSLT
YAML
Author:
⌘+⏎ or Ctrl+⏎
Expire in
One Time Snippet
In one hour
In one week
In one month