Skip to content

Commit 7f6d739

Browse files
[Basic] Use StringRef::drop_back (NFC) (#146195)
1 parent eff28bd commit 7f6d739

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/Basic/FileManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ FileManager::getDirectoryRef(StringRef DirName, bool CacheFailure) {
141141
if (DirName.size() > 1 &&
142142
DirName != llvm::sys::path::root_path(DirName) &&
143143
llvm::sys::path::is_separator(DirName.back()))
144-
DirName = DirName.substr(0, DirName.size()-1);
144+
DirName = DirName.drop_back();
145145
std::optional<std::string> DirNameStr;
146146
if (is_style_windows(llvm::sys::path::Style::native)) {
147147
// Fixing a problem with "clang C:test.c" on Windows.

0 commit comments

Comments
 (0)