Skip to content

Commit d4fe3e8

Browse files
committed
[clang-doc] switch to string ref
1 parent 3823807 commit d4fe3e8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

clang-tools-extra/clang-doc/Mapper.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,12 @@ template <typename T> bool MapASTVisitor::mapDecl(const T *D,
4343
// Prevent Visiting USR twice
4444
{
4545
std::lock_guard<llvm::sys::Mutex> Guard(USRVisitedGuard);
46-
if (USRVisited.count(USR.str()))
46+
StringRef Visited = USR.str();
47+
if (USRVisited.count(Visited))
4748
return true;
4849
// We considered a USR to be visited only when its defined
4950
if (IsDefinition)
50-
USRVisited.insert(USR.str());
51+
USRVisited.insert(Visited);
5152
}
5253

5354
bool IsFileInRootDir;

0 commit comments

Comments
 (0)