From 12234f8093b39bbd9ca9235be98d44a7cc7d59f2 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Wed, 19 Jul 2017 21:40:26 +0000 Subject: Use StringRef::contains(). llvm-svn: 308526 --- lld/lib/Core/Reproduce.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lld/lib/Core/Reproduce.cpp') diff --git a/lld/lib/Core/Reproduce.cpp b/lld/lib/Core/Reproduce.cpp index e3629a93cbe..6295e628bcd 100644 --- a/lld/lib/Core/Reproduce.cpp +++ b/lld/lib/Core/Reproduce.cpp @@ -44,9 +44,9 @@ std::string lld::relativeToRoot(StringRef Path) { // Quote a given string if it contains a space character. std::string lld::quote(StringRef S) { - if (S.find(' ') == StringRef::npos) - return S; - return ("\"" + S + "\"").str(); + if (S.contains(' ')) + return ("\"" + S + "\"").str(); + return S; } std::string lld::rewritePath(StringRef S) { -- cgit v1.2.3