summary refs log tree commit diff
path: root/lib/attrsets.nix
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2016-04-14 17:47:28 +0300
committerNikolay Amiantov <ab@fmap.me>2016-04-25 13:22:41 +0300
commit5f3987f44f81d2ca7bae266cdb1b26bd6d50b6c8 (patch)
treefa7c62c89f96be18091c28b83b1d2e2c94510ffa /lib/attrsets.nix
parent31d76ae1b1f8c3ef71e84dd002f0c9396edfa6ca (diff)
downloadnixpkgs-5f3987f44f81d2ca7bae266cdb1b26bd6d50b6c8.tar
nixpkgs-5f3987f44f81d2ca7bae266cdb1b26bd6d50b6c8.tar.gz
nixpkgs-5f3987f44f81d2ca7bae266cdb1b26bd6d50b6c8.tar.bz2
nixpkgs-5f3987f44f81d2ca7bae266cdb1b26bd6d50b6c8.tar.lz
nixpkgs-5f3987f44f81d2ca7bae266cdb1b26bd6d50b6c8.tar.xz
nixpkgs-5f3987f44f81d2ca7bae266cdb1b26bd6d50b6c8.tar.zst
nixpkgs-5f3987f44f81d2ca7bae266cdb1b26bd6d50b6c8.zip
Revert "tryAttrs: init function"
This reverts commit 338340f993563551d8cb45941da987408abef65f.
Diffstat (limited to 'lib/attrsets.nix')
-rw-r--r--lib/attrsets.nix18
1 files changed, 0 insertions, 18 deletions
diff --git a/lib/attrsets.nix b/lib/attrsets.nix
index 70986195ae0..4161fa546c8 100644
--- a/lib/attrsets.nix
+++ b/lib/attrsets.nix
@@ -438,24 +438,6 @@ rec {
   overrideExisting = old: new:
     old // listToAttrs (map (attr: nameValuePair attr (attrByPath [attr] old.${attr} new)) (attrNames old));
 
-  /* Try given attributes in order. If no attributes are found, return
-     attribute list itself.
-
-     Example:
-       tryAttrs ["a" "b"] { a = 1; b = 2; }
-       => 1
-       tryAttrs ["a" "b"] { c = 3; }
-       => { c = 3; }
-  */
-  tryAttrs = allAttrs: set:
-    let tryAttrs_ = attrs:
-      if attrs == [] then set
-      else
-        (let h = head attrs; in
-         if hasAttr h set then getAttr h set
-         else tryAttrs_ (tail attrs));
-    in tryAttrs_ allAttrs;
-
 
   /*** deprecated stuff ***/