about summary refs log tree commit diff
path: root/third_party/nix/src/libstore/local-store.hh
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-05-25T14·54+0100
committerVincent Ambo <tazjin@google.com>2020-05-25T14·54+0100
commitbf452cbc2ae2b209ec262ce858deca470d086f24 (patch)
tree198e98902be569301ecb9a821b0c9512b128f930 /third_party/nix/src/libstore/local-store.hh
parentb99b368d17f2e806a61f7abb83c6d3a9e4bbdc38 (diff)
refactor(3p/nix): Replace tokenizeStrings with absl::StrSplit r/846
This function was a custom (and inefficient in the case of
single-character delimiters) string splitter which was used all over
the codebase. Abseil provides an appropriate replacement function.
Diffstat (limited to 'third_party/nix/src/libstore/local-store.hh')
-rw-r--r--third_party/nix/src/libstore/local-store.hh6
1 files changed, 5 insertions, 1 deletions
diff --git a/third_party/nix/src/libstore/local-store.hh b/third_party/nix/src/libstore/local-store.hh
index c1bfc08764..178cadf92b 100644
--- a/third_party/nix/src/libstore/local-store.hh
+++ b/third_party/nix/src/libstore/local-store.hh
@@ -5,6 +5,8 @@
 #include <string>
 #include <unordered_set>
 
+#include <absl/strings/str_split.h>
+
 #include "pathlocks.hh"
 #include "sqlite.hh"
 #include "store-api.hh"
@@ -94,7 +96,9 @@ class LocalStore : public LocalFSStore {
 
  public:
   // Hack for build-remote.cc.
-  PathSet locksHeld = tokenizeString<PathSet>(getEnv("NIX_HELD_LOCKS"));
+  // TODO(tazjin): remove this when we've got gRPC
+  PathSet locksHeld =
+      absl::StrSplit(getEnv("NIX_HELD_LOCKS"), absl::ByAnyChar(" \t\n\r"));
 
   /* Initialise the local store, upgrading the schema if
      necessary. */