Remove many superfluous SmallString::str() calls.
Now that SmallString is a first-class citizen, most SmallString::str() calls are not required. This patch removes a whole bunch of them, yet there are lots more. There are two use cases where str() is really needed: 1) To use one of StringRef member functions which is not available in SmallString. 2) To convert to std::string, as StringRef implicitly converts while SmallString do not. We may wish to change this, but it may introduce ambiguity. llvm-svn: 232622
This commit is contained in:
@@ -1134,7 +1134,7 @@ VFSFromYamlDirIterImpl::VFSFromYamlDirIterImpl(const Twine &_Path,
|
||||
if (Current != End) {
|
||||
SmallString<128> PathStr(Dir);
|
||||
llvm::sys::path::append(PathStr, (*Current)->getName());
|
||||
llvm::ErrorOr<vfs::Status> S = FS.status(PathStr.str());
|
||||
llvm::ErrorOr<vfs::Status> S = FS.status(PathStr);
|
||||
if (S)
|
||||
CurrentEntry = *S;
|
||||
else
|
||||
@@ -1147,7 +1147,7 @@ std::error_code VFSFromYamlDirIterImpl::increment() {
|
||||
if (++Current != End) {
|
||||
SmallString<128> PathStr(Dir);
|
||||
llvm::sys::path::append(PathStr, (*Current)->getName());
|
||||
llvm::ErrorOr<vfs::Status> S = FS.status(PathStr.str());
|
||||
llvm::ErrorOr<vfs::Status> S = FS.status(PathStr);
|
||||
if (!S)
|
||||
return S.getError();
|
||||
CurrentEntry = *S;
|
||||
|
||||
Reference in New Issue
Block a user