[clang-tidy] Remove redudant .get on smart pointer

Found with readability-redundant-smartptr-get
This commit is contained in:
Rosen Penev 2019-12-21 12:42:12 -08:00
parent 2ecc386121
commit 9e42b0100a
No known key found for this signature in database
GPG Key ID: 36D31CFA845F0E3B
2 changed files with 3 additions and 3 deletions

View File

@ -311,7 +311,7 @@ unique_ptr<expression> test_parser::parse_unary_expression(unsigned int start, u
token_t tok = token_for_string(arg(start))->tok;
if (tok == test_bang) {
unique_ptr<expression> subject(parse_unary_expression(start + 1, end));
if (subject.get()) {
if (subject) {
return make_unique<unary_operator>(tok, range_t(start, subject->range.end),
move(subject));
}
@ -496,7 +496,7 @@ unique_ptr<expression> 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<expression> subject(parse_3_arg_expression(start + 1, end));
if (subject.get()) {
if (subject) {
result = make_unique<unary_operator>(first_token, range_t(start, subject->range.end),
move(subject));
}

View File

@ -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);