Use explicit conversion to std::string for look up in Protobuf maps

This is needed for some compiler versions where `absl::string_view` == `std::string_view`.

PiperOrigin-RevId: 367392064
Change-Id: Id91d23510501df4745f386475ef9049d94062e1b
This commit is contained in:
Christian Blichmann 2021-04-08 02:50:54 -07:00 committed by Copybara-Service
parent 6edd16f1b3
commit 17f561f221
2 changed files with 3 additions and 3 deletions

View File

@ -17,7 +17,7 @@ set(workdir "${CMAKE_BINARY_DIR}/_deps/absl-populate")
set(SAPI_ABSL_GIT_REPOSITORY https://github.com/abseil/abseil-cpp.git
CACHE STRING "")
set(SAPI_ABSL_GIT_TAG b315753c0b8b4aa4e3e1479375eddb518393bab6
CACHE STRING "") # 2020-11-19
CACHE STRING "") # 2021-02-18
set(SAPI_ABSL_SOURCE_DIR "${CMAKE_BINARY_DIR}/_deps/absl-src" CACHE STRING "")
set(SAPI_ABSL_BINARY_DIR "${CMAKE_BINARY_DIR}/_deps/absl-build" CACHE STRING "")

View File

@ -51,7 +51,7 @@ namespace file_util = ::sapi::file_util;
namespace host_cpu = ::sapi::host_cpu;
bool PathContainsNullByte(absl::string_view path) {
return absl::StrContains(path, '\x00');
return absl::StrContains(path, '\0');
}
bool IsSameFile(const std::string& path1, const std::string& path2) {
@ -277,7 +277,7 @@ absl::StatusOr<std::string> Mounts::ResolvePath(absl::string_view path) const {
while (!tail.empty()) {
std::pair<absl::string_view, absl::string_view> parts =
absl::StrSplit(tail, absl::MaxSplits('/', 1));
absl::string_view cur = parts.first;
const std::string cur(parts.first);
tail = parts.second;
const auto it = curtree->entries().find(cur);
if (it == curtree->entries().end()) {