Skip to content

Commit

Permalink
Use string() instead of native() to avoid the wstring in Windows
Browse files Browse the repository at this point in the history
Summary: `path.native()` in Windows returns a `wstring`. I think we can get away with `path.string()` in these cases.

Reviewed By: phlalx

Differential Revision: D55515303

fbshipit-source-id: 271d9cd1b8748be04dc1b0fd3b1dfe1b5b6470e9
  • Loading branch information
mpark authored and facebook-github-bot committed Apr 12, 2024
1 parent 0a49785 commit 4426b27
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions glean/lang/clang/db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ ClangDB::fileFromEntry(
#endif
}();
if (!buffer) {
LOG(WARNING) << "Couldn't get MemoryBuffer for " << path.native();
LOG(WARNING) << "Couldn't get MemoryBuffer for " << path.string();
#if GLEAN_FACEBOOK
if (isBuckOutPath(path)) {
return {};
}
#endif
const auto file = batch.fact<Src::File>(path.native());
const auto file = batch.fact<Src::File>(path.string());
return std::pair{file, std::move(path)};
}
// compute the SHA1 digest of the file content and get the file size
Expand All @@ -94,7 +94,7 @@ ClangDB::fileFromEntry(
path = replaceBuckOutHash(path, hash);
}
#endif
const auto file = batch.fact<Src::File>(path.native());
const auto file = batch.fact<Src::File>(path.string());
const uint64_t size = entry.getSize();
batch.fact<Digest::FileDigest>(file, Digest::Digest{hash, size});

Expand Down

0 comments on commit 4426b27

Please sign in to comment.