From 381ce8a66658ac9d02c44e96c860cd05bcb6a5f8 Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Mon, 7 Sep 2020 13:01:49 -0400 Subject: refactor(tvix): Make static strings constexpr string_views Make all static std::strings constexpr std::string_views, and replace concatenation with absl::StrCat where necessary. Technically all of these are constant, so they really don't need to be top-level statics - and since I'm trying to get rid of as much global state as possible in preparation for making the nix daemon properly multithreaded I figured I'd knock these out while I was at it. Change-Id: Ibd3ad9ef68f0a0eacb135541b39fdb13dae042e1 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1939 Tested-by: BuildkiteCI Reviewed-by: tazjin --- third_party/nix/src/libutil/archive.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'third_party/nix/src/libutil/archive.hh') diff --git a/third_party/nix/src/libutil/archive.hh b/third_party/nix/src/libutil/archive.hh index 194d31d078..3966278785 100644 --- a/third_party/nix/src/libutil/archive.hh +++ b/third_party/nix/src/libutil/archive.hh @@ -72,6 +72,6 @@ void restorePath(const Path& path, Source& source); /* Read a NAR from 'source' and write it to 'sink'. */ void copyNAR(Source& source, Sink& sink); -extern const std::string narVersionMagic1; +constexpr std::string_view kNarVersionMagic1 = "nix-archive-1"; } // namespace nix -- cgit 1.4.1