Skip to content

Commit

Permalink
Fix clang-tidy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
avsej committed Oct 12, 2024
1 parent d6d68b8 commit 45998bb
Show file tree
Hide file tree
Showing 24 changed files with 97 additions and 96 deletions.
4 changes: 2 additions & 2 deletions core/collections_component.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ collection_id_cache_entry_impl::refresh_collection_id(
self->manager_.lock()->remove(req->scope_name_, req->collection_name_);
auto queue = self->swap_queue();
queue->close();
return queue->drain([ec](auto r) {
return queue->drain([ec](const auto& r) {
r->try_callback({}, ec);
});
}
Expand All @@ -443,7 +443,7 @@ collection_id_cache_entry_impl::refresh_collection_id(
res.collection_id);
auto queue = self->swap_queue();
queue->close();
return queue->drain([self](auto r) {
return queue->drain([self](const auto& r) {
if (auto ec = self->assign_collection_id(r); ec) {
CB_LOG_DEBUG("failed to set collection ID \"{}.{}\" on request (OP={}): {}",
r->scope_name_,
Expand Down
6 changes: 3 additions & 3 deletions core/columnar/management_component.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ class management_component_impl
"SELECT d.* FROM `System`.`Metadata`.`Database` AS d",
options.timeout,
};
return execute(std::move(req), [cb = std::move(callback)](auto raw_res, auto err) {
return execute(std::move(req), [cb = std::move(callback)](const auto& raw_res, auto err) {
if (err) {
cb({}, std::move(err));
return;
Expand All @@ -216,7 +216,7 @@ class management_component_impl
if (options.ignore_if_exists) {
req.statement += " IF NOT EXISTS";
}
return execute(std::move(req), [cb = std::move(callback)](auto /*raw_res*/, auto err) {
return execute(std::move(req), [cb = std::move(callback)](const auto& /*raw_res*/, auto err) {
cb(std::move(err));
});
}
Expand All @@ -231,7 +231,7 @@ class management_component_impl
if (options.ignore_if_not_exists) {
req.statement += " IF EXISTS";
}
return execute(std::move(req), [cb = std::move(callback)](auto /*raw_res*/, auto err) {
return execute(std::move(req), [cb = std::move(callback)](const auto& /*raw_res*/, auto err) {
cb(std::move(err));
});
}
Expand Down
2 changes: 1 addition & 1 deletion core/columnar/query_component.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class pending_query_operation
}
auto streamer = std::make_shared<row_streamer>(self->io_, resp.body(), "/results/^");
return streamer->start(
[self, streamer, resp = std::move(resp)](auto metadata_header, auto ec) mutable {
[self, streamer, resp = std::move(resp)](const auto& metadata_header, auto ec) mutable {
if (ec) {
self->invoke_callback({}, { maybe_convert_error_code(ec) });
return;
Expand Down
30 changes: 15 additions & 15 deletions core/impl/analytics_index_manager.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class analytics_index_manager_impl
{},
options.timeout,
},
[dataverse_name, handler = std::move(handler)](auto resp) {
[dataverse_name, handler = std::move(handler)](const auto& resp) {
CB_LOG_DEBUG(
"Dataverse create for {} error code = {}", dataverse_name, resp.ctx.ec.value());
handler(core::impl::make_error(resp.ctx));
Expand All @@ -177,7 +177,7 @@ class analytics_index_manager_impl
{},
options.timeout,
},
[handler = std::move(handler)](auto resp) {
[handler = std::move(handler)](const auto& resp) {
handler(core::impl::make_error(resp.ctx));
});
}
Expand All @@ -197,7 +197,7 @@ class analytics_index_manager_impl
options.timeout,
options.ignore_if_exists,
},
[handler = std::move(handler)](auto resp) {
[handler = std::move(handler)](const auto& resp) {
handler(core::impl::make_error(resp.ctx));
});
}
Expand All @@ -214,7 +214,7 @@ class analytics_index_manager_impl
{},
options.timeout,
},
[handler = std::move(handler)](auto resp) {
[handler = std::move(handler)](const auto& resp) {
handler(core::impl::make_error(resp.ctx));
});
}
Expand Down Expand Up @@ -262,7 +262,7 @@ class analytics_index_manager_impl
{},
options.timeout,
},
[handler = std::move(handler)](auto resp) {
[handler = std::move(handler)](const auto& resp) {
handler(core::impl::make_error(resp.ctx));
});
}
Expand All @@ -281,7 +281,7 @@ class analytics_index_manager_impl
{},
options.timeout,
},
[handler = std::move(handler)](auto resp) {
[handler = std::move(handler)](const auto& resp) {
handler(core::impl::make_error(resp.ctx));
});
}
Expand Down Expand Up @@ -324,7 +324,7 @@ class analytics_index_manager_impl
{},
options.timeout,
},
[handler = std::move(handler)](auto resp) {
[handler = std::move(handler)](const auto& resp) {
handler(core::impl::make_error(resp.ctx));
});
}
Expand All @@ -339,7 +339,7 @@ class analytics_index_manager_impl
{},
options.timeout,
},
[handler = std::move(handler)](auto resp) {
[handler = std::move(handler)](const auto& resp) {
handler(core::impl::make_error(resp.ctx));
});
}
Expand Down Expand Up @@ -386,7 +386,7 @@ class analytics_index_manager_impl
{},
options.timeout,
},
[handler = std::move(handler)](auto resp) {
[handler = std::move(handler)](const auto& resp) {
handler(core::impl::make_error(resp.ctx));
});

Expand All @@ -398,7 +398,7 @@ class analytics_index_manager_impl
{},
options.timeout,
},
[handler = std::move(handler)](auto resp) {
[handler = std::move(handler)](const auto& resp) {
handler(core::impl::make_error(resp.ctx));
});

Expand All @@ -410,7 +410,7 @@ class analytics_index_manager_impl
{},
options.timeout,
},
[handler = std::move(handler)](auto resp) {
[handler = std::move(handler)](const auto& resp) {
handler(core::impl::make_error(resp.ctx));
});
}
Expand All @@ -429,7 +429,7 @@ class analytics_index_manager_impl
{},
options.timeout,
},
[handler = std::move(handler)](auto resp) {
[handler = std::move(handler)](const auto& resp) {
handler(core::impl::make_error(resp.ctx));
});

Expand All @@ -441,7 +441,7 @@ class analytics_index_manager_impl
{},
options.timeout,
},
[handler = std::move(handler)](auto resp) {
[handler = std::move(handler)](const auto& resp) {
handler(core::impl::make_error(resp.ctx));
});

Expand All @@ -453,7 +453,7 @@ class analytics_index_manager_impl
{},
options.timeout,
},
[handler = std::move(handler)](auto resp) {
[handler = std::move(handler)](const auto& resp) {
handler(core::impl::make_error(resp.ctx));
});
}
Expand All @@ -471,7 +471,7 @@ class analytics_index_manager_impl
{},
options.timeout,
},
[handler = std::move(handler)](auto resp) {
[handler = std::move(handler)](const auto& resp) {
handler(core::impl::make_error(resp.ctx));
});
}
Expand Down
2 changes: 1 addition & 1 deletion core/impl/bucket.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class bucket_impl : public std::enable_shared_from_this<bucket_impl>
name_,
core::impl::to_core_service_types(options.service_types),
options.timeout,
[handler = std::move(handler)](auto resp) mutable {
[handler = std::move(handler)](const auto& resp) mutable {
return handler({}, core::impl::build_result(resp));
});
}
Expand Down
12 changes: 6 additions & 6 deletions core/impl/bucket_manager.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ class bucket_manager_impl
{},
options.timeout,
},
[handler = std::move(handler)](auto resp) mutable {
[handler = std::move(handler)](const auto& resp) mutable {
return handler(core::impl::make_error(resp.ctx), map_bucket_settings(resp.bucket));
});
}
Expand All @@ -282,7 +282,7 @@ class bucket_manager_impl
{},
options.timeout,
},
[handler = std::move(handler)](auto resp) mutable {
[handler = std::move(handler)](const auto& resp) mutable {
return handler(core::impl::make_error(resp.ctx), map_all_bucket_settings(resp.buckets));
});
}
Expand All @@ -297,7 +297,7 @@ class bucket_manager_impl
{},
options.timeout,
},
[handler = std::move(handler)](auto resp) mutable {
[handler = std::move(handler)](const auto& resp) mutable {
return handler(core::impl::make_error(resp.ctx));
});
}
Expand All @@ -312,7 +312,7 @@ class bucket_manager_impl
{},
options.timeout,
},
[handler = std::move(handler)](auto resp) mutable {
[handler = std::move(handler)](const auto& resp) mutable {
return handler(core::impl::make_error(resp.ctx));
});
}
Expand All @@ -327,7 +327,7 @@ class bucket_manager_impl
{},
options.timeout,
},
[handler = std::move(handler)](auto resp) mutable {
[handler = std::move(handler)](const auto& resp) mutable {
return handler(core::impl::make_error(resp.ctx));
});
}
Expand All @@ -342,7 +342,7 @@ class bucket_manager_impl
{},
options.timeout,
},
[handler = std::move(handler)](auto resp) mutable {
[handler = std::move(handler)](const auto& resp) mutable {
return handler(core::impl::make_error(resp.ctx));
});
}
Expand Down
13 changes: 7 additions & 6 deletions core/impl/cluster.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ class cluster_impl : public std::enable_shared_from_this<cluster_impl>
}));
return;
}
impl->transactions_ = txns;
impl->transactions_ = std::move(txns);
handler(ec, couchbase::cluster(std::move(impl)));
});
});
Expand Down Expand Up @@ -323,16 +323,17 @@ class cluster_impl : public std::enable_shared_from_this<cluster_impl>
{},
core::impl::to_core_service_types(options.service_types),
options.timeout,
[handler = std::move(handler)](auto resp) mutable {
[handler = std::move(handler)](const auto& resp) mutable {
return handler({}, core::impl::build_result(resp));
});
};

void diagnostics(const diagnostics_options::built& options, diagnostics_handler&& handler) const
{
return core_.diagnostics(options.report_id, [handler = std::move(handler)](auto resp) mutable {
return handler({}, core::impl::build_result(resp));
});
return core_.diagnostics(options.report_id,
[handler = std::move(handler)](const auto& resp) mutable {
return handler({}, core::impl::build_result(resp));
});
}

void search(std::string index_name,
Expand All @@ -342,7 +343,7 @@ class cluster_impl : public std::enable_shared_from_this<cluster_impl>
{
return core_.execute(
core::impl::build_search_request(std::move(index_name), std::move(request), options, {}, {}),
[handler = std::move(handler)](auto resp) mutable {
[handler = std::move(handler)](const auto& resp) mutable {
return handler(core::impl::make_error(resp.ctx),
search_result{ internal_search_result{ resp } });
});
Expand Down
4 changes: 2 additions & 2 deletions core/impl/collection.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class collection_impl : public std::enable_shared_from_this<collection_impl>
options.timeout,
{ options.retry_strategy },
},
[handler = std::move(handler)](auto resp) mutable {
[handler = std::move(handler)](const auto& resp) mutable {
return handler(core::impl::make_error(std::move(resp.ctx)), result{ resp.cas });
});
}
Expand Down Expand Up @@ -1390,7 +1390,7 @@ collection::scan(const couchbase::scan_type& scan_type, const couchbase::scan_op
{
auto barrier = std::make_shared<std::promise<std::pair<error, scan_result>>>();
auto future = barrier->get_future();
scan(scan_type, options, [barrier](auto err, auto result) {
scan(scan_type, options, [barrier](const auto& err, auto result) {
barrier->set_value({ err, std::move(result) });
});
return future;
Expand Down
10 changes: 5 additions & 5 deletions core/impl/collection_manager.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class collection_manager_impl
{},
options.timeout,
},
[handler = std::move(handler)](auto resp) mutable {
[handler = std::move(handler)](const auto& resp) mutable {
return handler(core::impl::make_error(resp.ctx));
});
}
Expand All @@ -122,7 +122,7 @@ class collection_manager_impl
{},
options.timeout,
},
[handler = std::move(handler)](auto resp) mutable {
[handler = std::move(handler)](const auto& resp) mutable {
return handler(core::impl::make_error(resp.ctx));
});
}
Expand All @@ -143,7 +143,7 @@ class collection_manager_impl
{},
options.timeout,
},
[handler = std::move(handler)](auto resp) mutable {
[handler = std::move(handler)](const auto& resp) mutable {
return handler(core::impl::make_error(resp.ctx));
});
}
Expand Down Expand Up @@ -173,7 +173,7 @@ class collection_manager_impl
{},
options.timeout,
},
[handler = std::move(handler)](auto resp) mutable {
[handler = std::move(handler)](const auto& resp) mutable {
return handler(core::impl::make_error(resp.ctx));
});
}
Expand All @@ -189,7 +189,7 @@ class collection_manager_impl
{},
options.timeout,
},
[handler = std::move(handler)](auto resp) mutable {
[handler = std::move(handler)](const auto& resp) mutable {
return handler(core::impl::make_error(resp.ctx));
});
}
Expand Down
Loading

0 comments on commit 45998bb

Please sign in to comment.