From 9e42b0100ad44bfb8f5bb7f8dbfb47a1e699c2ea Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 21 Dec 2019 12:42:12 -0800 Subject: [PATCH] [clang-tidy] Remove redudant .get on smart pointer Found with readability-redundant-smartptr-get --- src/builtin_test.cpp | 4 ++-- src/io.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/builtin_test.cpp b/src/builtin_test.cpp index a3c9b640d..96080af99 100644 --- a/src/builtin_test.cpp +++ b/src/builtin_test.cpp @@ -311,7 +311,7 @@ unique_ptr test_parser::parse_unary_expression(unsigned int start, u token_t tok = token_for_string(arg(start))->tok; if (tok == test_bang) { unique_ptr subject(parse_unary_expression(start + 1, end)); - if (subject.get()) { + if (subject) { return make_unique(tok, range_t(start, subject->range.end), move(subject)); } @@ -496,7 +496,7 @@ unique_ptr test_parser::parse_4_arg_expression(unsigned int start, u token_t first_token = token_for_string(arg(start))->tok; if (first_token == test_bang) { unique_ptr subject(parse_3_arg_expression(start + 1, end)); - if (subject.get()) { + if (subject) { result = make_unique(first_token, range_t(start, subject->range.end), move(subject)); } diff --git a/src/io.cpp b/src/io.cpp index 54a8218da..8841da732 100644 --- a/src/io.cpp +++ b/src/io.cpp @@ -284,7 +284,7 @@ void io_chain_t::print() const { std::fwprintf(stderr, L"Chain %p (%ld items):\n", this, (long)this->size()); for (size_t i = 0; i < this->size(); i++) { const auto &io = this->at(i); - if (io.get() == nullptr) { + if (io == nullptr) { std::fwprintf(stderr, L"\t(null)\n"); } else { std::fwprintf(stderr, L"\t%lu: fd:%d, ", (unsigned long)i, io->fd);