Skip to content

Commit 5d305b6

Browse files
[clang-tools-extra] Remove redundant calls to std::unique_ptr<T>::get (NFC) (llvm#138774)
1 parent 796652d commit 5d305b6

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

clang-tools-extra/clang-change-namespace/ChangeNamespace.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ static SourceLocation getStartOfNextLine(SourceLocation Loc,
113113
const SourceManager &SM,
114114
const LangOptions &LangOpts) {
115115
std::unique_ptr<Lexer> Lex = getLexerStartingFromLoc(Loc, SM, LangOpts);
116-
if (!Lex.get())
116+
if (!Lex)
117117
return SourceLocation();
118118
llvm::SmallVector<char, 16> Line;
119119
// FIXME: this is a bit hacky to get ReadToEndOfLine work.
@@ -647,9 +647,8 @@ static SourceLocation getLocAfterNamespaceLBrace(const NamespaceDecl *NsDecl,
647647
const LangOptions &LangOpts) {
648648
std::unique_ptr<Lexer> Lex =
649649
getLexerStartingFromLoc(NsDecl->getBeginLoc(), SM, LangOpts);
650-
assert(Lex.get() &&
651-
"Failed to create lexer from the beginning of namespace.");
652-
if (!Lex.get())
650+
assert(Lex && "Failed to create lexer from the beginning of namespace.");
651+
if (!Lex)
653652
return SourceLocation();
654653
Token Tok;
655654
while (!Lex->LexFromRawLexer(Tok) && Tok.isNot(tok::TokenKind::l_brace)) {

clang-tools-extra/clangd/unittests/PrerequisiteModulesTest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -545,8 +545,8 @@ void func() {
545545
EXPECT_TRUE(Preamble);
546546
EXPECT_TRUE(Preamble->RequiredModules);
547547

548-
auto Result = signatureHelp(getFullPath("Use.cpp"), Test.point(),
549-
*Preamble.get(), Use, MarkupKind::PlainText);
548+
auto Result = signatureHelp(getFullPath("Use.cpp"), Test.point(), *Preamble,
549+
Use, MarkupKind::PlainText);
550550
EXPECT_FALSE(Result.signatures.empty());
551551
EXPECT_EQ(Result.signatures[0].label, "printA(int a) -> void");
552552
EXPECT_EQ(Result.signatures[0].parameters[0].labelString, "int a");

0 commit comments

Comments
 (0)