From 43677021e3c285c2ced2075b918da947e13fcb00 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 20 May 2020 22:58:43 +0100 Subject: refactor(3p/nix): Apply clang-tidy's performance-* fixes This applies the performance fixes listed here: https://clang.llvm.org/extra/clang-tidy/checks/list.html --- third_party/nix/src/libstore/profiles.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'third_party/nix/src/libstore/profiles.cc') diff --git a/third_party/nix/src/libstore/profiles.cc b/third_party/nix/src/libstore/profiles.cc index 7d16d9f62390..bdb90b7388f7 100644 --- a/third_party/nix/src/libstore/profiles.cc +++ b/third_party/nix/src/libstore/profiles.cc @@ -35,7 +35,7 @@ static int parseName(const string& profileName, const string& name) { return -1; } -Generations findGenerations(Path profile, int& curGen) { +Generations findGenerations(const Path& profile, int& curGen) { Generations gens; Path profileDir = dirOf(profile); @@ -68,7 +68,8 @@ static void makeName(const Path& profile, unsigned int num, Path& outLink) { outLink = prefix + "-link"; } -Path createGeneration(ref store, Path profile, Path outPath) { +Path createGeneration(const ref& store, const Path& profile, + const Path& outPath) { /* The new generation number should be higher than old the previous ones. */ int dummy; @@ -226,7 +227,7 @@ void deleteGenerationsOlderThan(const Path& profile, const string& timeSpec, deleteGenerationsOlderThan(profile, oldTime, dryRun); } -void switchLink(Path link, Path target) { +void switchLink(const Path& link, Path target) { /* Hacky. */ if (dirOf(target) == dirOf(link)) { target = baseNameOf(target); -- cgit 1.4.1