From 8d55251ebdbacd107c5bd06beb7b04afac7943b7 Mon Sep 17 00:00:00 2001 From: Alois Wohlschlager Date: Sun, 24 Aug 2025 14:15:06 +0200 Subject: [PATCH] libstore: remove StorePath::random It was only used for impure derivations, which were finally removed in commit be076298205b88ae68105b476b574108a53adbdf. Delete the unused function. Change-Id: I6a6a696481711f68a8c3ea7eac7978fcf5884cce --- lix/libstore/path.cc | 9 --------- lix/libstore/path.hh | 2 -- 2 files changed, 11 deletions(-) diff --git a/lix/libstore/path.cc b/lix/libstore/path.cc index 706bd3edc..f99710768 100644 --- a/lix/libstore/path.cc +++ b/lix/libstore/path.cc @@ -1,7 +1,5 @@ #include "lix/libstore/store-api.hh" -#include - namespace nix { static void checkName(std::string_view path, std::string_view name) @@ -62,13 +60,6 @@ bool StorePath::isDerivation() const StorePath StorePath::dummy("ffffffffffffffffffffffffffffffff-x"); -StorePath StorePath::random(std::string_view name) -{ - Hash hash(HashType::SHA1); - randombytes_buf(hash.hash, hash.hashSize); - return StorePath(hash, name); -} - StorePath Store::parseStorePath(std::string_view path) const { auto p = canonPath(std::string(path)); diff --git a/lix/libstore/path.hh b/lix/libstore/path.hh index 44f494bb7..c185f141d 100644 --- a/lix/libstore/path.hh +++ b/lix/libstore/path.hh @@ -72,8 +72,6 @@ public: } static StorePath dummy; - - static StorePath random(std::string_view name); }; typedef std::set StorePathSet;