refactor(3p/nix/libutil): Replace hasPrefix/Suffix with Abseil
Uses the equivalent absl::StartsWith and absl::EndsWith functions instead.
This commit is contained in:
parent
8cf1322a6f
commit
b99b368d17
21 changed files with 69 additions and 57 deletions
4
third_party/nix/src/libstore/ssh.cc
vendored
4
third_party/nix/src/libstore/ssh.cc
vendored
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
#include <utility>
|
||||
|
||||
#include <absl/strings/match.h>
|
||||
|
||||
namespace nix {
|
||||
|
||||
SSHMaster::SSHMaster(const std::string& host, std::string keyFile,
|
||||
|
|
@ -12,7 +14,7 @@ SSHMaster::SSHMaster(const std::string& host, std::string keyFile,
|
|||
useMaster(useMaster && !fakeSSH),
|
||||
compress(compress),
|
||||
logFD(logFD) {
|
||||
if (host.empty() || hasPrefix(host, "-")) {
|
||||
if (host.empty() || absl::StartsWith(host, "-")) {
|
||||
throw Error("invalid SSH host name '%s'", host);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue