Address some warnings from clangd

This commit is contained in:
Johannes Altmanninger 2020-08-27 22:28:17 +02:00
parent 021d4157ca
commit a20721a278
2 changed files with 4 additions and 4 deletions

View file

@ -125,7 +125,7 @@ class token_stream_t {
if (count_ == 0) { if (count_ == 0) {
return next_from_tok(); return next_from_tok();
} }
parse_token_t result = std::move(lookahead_[start_]); parse_token_t result = lookahead_[start_];
start_ = mask(start_ + 1); start_ = mask(start_ + 1);
count_ -= 1; count_ -= 1;
return result; return result;
@ -471,7 +471,7 @@ class ast_t::populator_t {
/// \return whether the status is unwinding. /// \return whether the status is unwinding.
/// This is more efficient than checking the status directly. /// This is more efficient than checking the status directly.
bool is_unwinding() { return unwinding_; } bool is_unwinding() const { return unwinding_; }
/// \return whether any leaf nodes we visit should be marked as unsourced. /// \return whether any leaf nodes we visit should be marked as unsourced.
bool unsource_leaves() { bool unsource_leaves() {
@ -933,7 +933,7 @@ class ast_t::populator_t {
// We're going to heap-allocate our array. // We're going to heap-allocate our array.
using contents_ptr_t = typename list_t<ListType, ContentsNode>::contents_ptr_t; using contents_ptr_t = typename list_t<ListType, ContentsNode>::contents_ptr_t;
contents_ptr_t *array = new contents_ptr_t[contents.size()]; auto *array = new contents_ptr_t[contents.size()];
std::move(contents.begin(), contents.end(), array); std::move(contents.begin(), contents.end(), array);
list.length = static_cast<uint32_t>(contents.size()); list.length = static_cast<uint32_t>(contents.size());

View file

@ -1043,7 +1043,7 @@ maybe_t<edit_t> reader_expand_abbreviation_in_command(const wcstring &cmdline, s
// Look for plain statements where the cursor is at the end of the command. // Look for plain statements where the cursor is at the end of the command.
const ast::string_t *matching_cmd_node = nullptr; const ast::string_t *matching_cmd_node = nullptr;
for (const node_t &n : ast) { for (const node_t &n : ast) {
const decorated_statement_t *stmt = n.try_as<decorated_statement_t>(); const auto *stmt = n.try_as<decorated_statement_t>();
if (!stmt) continue; if (!stmt) continue;
// Skip if we have a decoration. // Skip if we have a decoration.