mirror of https://gitee.com/bigwinds/arangodb
cppcheck
This commit is contained in:
parent
667dc8af49
commit
c6efe26198
|
@ -63,7 +63,7 @@ struct read_ret_t {
|
|||
std::string redirect; ///< @brief If not accepted redirect id
|
||||
std::vector<bool> success; ///< @brief Query's precond OK
|
||||
query_t result; ///< @brief Query result
|
||||
read_ret_t(bool a, std::string id, std::vector<bool> suc = std::vector<bool>(),
|
||||
read_ret_t(bool a, std::string const& id, std::vector<bool> const& suc = std::vector<bool>(),
|
||||
query_t res = nullptr)
|
||||
: accepted(a), redirect(id), success(suc), result(res) {}
|
||||
};
|
||||
|
@ -76,8 +76,8 @@ struct write_ret_t {
|
|||
std::vector<bool> applied;
|
||||
std::vector<index_t> indices; // Indices of log entries (if any) to wait for
|
||||
write_ret_t() : accepted(false), redirect("") {}
|
||||
write_ret_t(bool a, std::string id) : accepted(a), redirect(id) {}
|
||||
write_ret_t(bool a, std::string id, std::vector<bool> const& app,
|
||||
write_ret_t(bool a, std::string const& id) : accepted(a), redirect(id) {}
|
||||
write_ret_t(bool a, std::string const& id, std::vector<bool> const& app,
|
||||
std::vector<index_t> const& idx)
|
||||
: accepted(a), redirect(id), applied(app), indices(idx) {}
|
||||
};
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
using namespace arangodb::consensus;
|
||||
|
||||
NotifyCallback::NotifyCallback(std::function<void(bool)> cb) : _cb(cb) {}
|
||||
NotifyCallback::NotifyCallback(std::function<void(bool)> const& cb) : _cb(cb) {}
|
||||
|
||||
bool NotifyCallback::operator()(arangodb::ClusterCommResult* res) {
|
||||
_cb(res->status == CL_COMM_SENT && res->result->getHttpReturnCode() == 200);
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace consensus {
|
|||
|
||||
class NotifyCallback : public arangodb::ClusterCommCallback {
|
||||
public:
|
||||
explicit NotifyCallback(std::function<void(bool)>);
|
||||
explicit NotifyCallback(std::function<void(bool)> const&);
|
||||
|
||||
virtual bool operator()(arangodb::ClusterCommResult*) override final;
|
||||
|
||||
|
|
|
@ -63,13 +63,13 @@ class Supervision : public arangodb::Thread {
|
|||
};
|
||||
|
||||
struct VitalSign {
|
||||
VitalSign(ServerStatus s, ServerTimestamp t)
|
||||
VitalSign(ServerStatus const& s, ServerTimestamp const& t)
|
||||
: myTimestamp(std::chrono::system_clock::now()),
|
||||
serverStatus(s),
|
||||
serverTimestamp(t),
|
||||
jobId("0") {}
|
||||
|
||||
void update(ServerStatus s, ServerTimestamp t) {
|
||||
void update(ServerStatus const& s, ServerTimestamp const& t) {
|
||||
myTimestamp = std::chrono::system_clock::now();
|
||||
serverStatus = s;
|
||||
serverTimestamp = t;
|
||||
|
|
|
@ -218,7 +218,7 @@ class Optimizer {
|
|||
|
||||
Rule() = delete;
|
||||
|
||||
Rule(std::string const& name, RuleFunction func, RuleLevel level,
|
||||
Rule(std::string const& name, RuleFunction const& func, RuleLevel level,
|
||||
bool canCreateAdditionalPlans, bool canBeDisabled, bool isHidden)
|
||||
: name(name),
|
||||
func(func),
|
||||
|
@ -435,7 +435,7 @@ class Optimizer {
|
|||
}
|
||||
|
||||
/// @brief register a hidden rule
|
||||
static void registerHiddenRule(std::string const& name, RuleFunction func,
|
||||
static void registerHiddenRule(std::string const& name, RuleFunction const& func,
|
||||
RuleLevel level, bool canCreateAdditionalPlans, bool canBeDisabled) {
|
||||
registerRule(name, func, level, canCreateAdditionalPlans, canBeDisabled, true);
|
||||
}
|
||||
|
|
|
@ -160,7 +160,7 @@ ShortestPathNode::ShortestPathNode(ExecutionPlan* plan, size_t id,
|
|||
ShortestPathNode::ShortestPathNode(ExecutionPlan* plan, size_t id,
|
||||
TRI_vocbase_t* vocbase,
|
||||
std::vector<std::string> const& edgeColls,
|
||||
std::vector<TRI_edge_direction_e> directions,
|
||||
std::vector<TRI_edge_direction_e> const& directions,
|
||||
Variable const* inStartVariable,
|
||||
std::string const& startVertexId,
|
||||
Variable const* inTargetVariable,
|
||||
|
|
|
@ -56,7 +56,7 @@ class ShortestPathNode : public ExecutionNode {
|
|||
private:
|
||||
ShortestPathNode(ExecutionPlan* plan, size_t id, TRI_vocbase_t* vocbase,
|
||||
std::vector<std::string> const& edgeColls,
|
||||
std::vector<TRI_edge_direction_e> directions,
|
||||
std::vector<TRI_edge_direction_e> const& directions,
|
||||
Variable const* inStartVariable,
|
||||
std::string const& startVertexId,
|
||||
Variable const* inTargetVariable,
|
||||
|
|
|
@ -251,7 +251,7 @@ TraversalNode::TraversalNode(ExecutionPlan* plan, size_t id,
|
|||
TraversalNode::TraversalNode(
|
||||
ExecutionPlan* plan, size_t id, TRI_vocbase_t* vocbase,
|
||||
std::vector<std::string> const& edgeColls, Variable const* inVariable,
|
||||
std::string const& vertexId, std::vector<TRI_edge_direction_e> directions,
|
||||
std::string const& vertexId, std::vector<TRI_edge_direction_e> const& directions,
|
||||
uint64_t minDepth, uint64_t maxDepth, TraversalOptions const& options)
|
||||
: ExecutionNode(plan, id),
|
||||
_vocbase(vocbase),
|
||||
|
|
|
@ -84,7 +84,7 @@ class TraversalNode : public ExecutionNode {
|
|||
TraversalNode(ExecutionPlan* plan, size_t id, TRI_vocbase_t* vocbase,
|
||||
std::vector<std::string> const& edgeColls,
|
||||
Variable const* inVariable, std::string const& vertexId,
|
||||
std::vector<TRI_edge_direction_e> directions, uint64_t minDepth,
|
||||
std::vector<TRI_edge_direction_e> const& directions, uint64_t minDepth,
|
||||
uint64_t maxDepth, TraversalOptions const& options);
|
||||
|
||||
public:
|
||||
|
|
|
@ -39,7 +39,7 @@ class ClusterTraverser final : public Traverser {
|
|||
|
||||
public:
|
||||
ClusterTraverser(
|
||||
std::vector<std::string> edgeCollections, TraverserOptions& opts,
|
||||
std::vector<std::string> const& edgeCollections, TraverserOptions& opts,
|
||||
std::string const& dbname, Transaction* trx)
|
||||
: Traverser(opts),
|
||||
_edgeCols(edgeCollections),
|
||||
|
|
|
@ -253,7 +253,7 @@ class SkiplistIterator2 : public IndexIterator {
|
|||
SkiplistIterator2(
|
||||
TRI_Skiplist const* skiplist,
|
||||
std::function<int(TRI_index_element_t const*, TRI_index_element_t const*,
|
||||
arangodb::basics::SkipListCmpType)> CmpElmElm,
|
||||
arangodb::basics::SkipListCmpType)> const& CmpElmElm,
|
||||
bool reverse, BaseSkiplistLookupBuilder* builder)
|
||||
: _skiplistIndex(skiplist),
|
||||
_reverse(reverse),
|
||||
|
|
|
@ -85,7 +85,7 @@ CompactionDitch::~CompactionDitch() {}
|
|||
|
||||
DropDatafileDitch::DropDatafileDitch(
|
||||
Ditches* ditches, TRI_datafile_t* datafile, LogicalCollection* collection,
|
||||
std::function<void(TRI_datafile_t*, LogicalCollection*)> callback, char const* filename,
|
||||
std::function<void(TRI_datafile_t*, LogicalCollection*)> const& callback, char const* filename,
|
||||
int line)
|
||||
: Ditch(ditches, filename, line),
|
||||
_datafile(datafile),
|
||||
|
@ -96,7 +96,7 @@ DropDatafileDitch::~DropDatafileDitch() {}
|
|||
|
||||
RenameDatafileDitch::RenameDatafileDitch(
|
||||
Ditches* ditches, TRI_datafile_t* datafile, void* data,
|
||||
std::function<void(TRI_datafile_t*, void*)> callback, char const* filename,
|
||||
std::function<void(TRI_datafile_t*, void*)> const& callback, char const* filename,
|
||||
int line)
|
||||
: Ditch(ditches, filename, line),
|
||||
_datafile(datafile),
|
||||
|
@ -107,7 +107,7 @@ RenameDatafileDitch::~RenameDatafileDitch() {}
|
|||
|
||||
UnloadCollectionDitch::UnloadCollectionDitch(
|
||||
Ditches* ditches, LogicalCollection* collection,
|
||||
std::function<bool(LogicalCollection*)> callback,
|
||||
std::function<bool(LogicalCollection*)> const& callback,
|
||||
char const* filename, int line)
|
||||
: Ditch(ditches, filename, line),
|
||||
_collection(collection),
|
||||
|
@ -417,7 +417,7 @@ CompactionDitch* Ditches::createCompactionDitch(char const* filename,
|
|||
|
||||
DropDatafileDitch* Ditches::createDropDatafileDitch(
|
||||
TRI_datafile_t* datafile, LogicalCollection* collection,
|
||||
std::function<void(struct TRI_datafile_t*, LogicalCollection*)> callback,
|
||||
std::function<void(struct TRI_datafile_t*, LogicalCollection*)> const& callback,
|
||||
char const* filename, int line) {
|
||||
try {
|
||||
auto ditch =
|
||||
|
@ -436,7 +436,7 @@ DropDatafileDitch* Ditches::createDropDatafileDitch(
|
|||
|
||||
RenameDatafileDitch* Ditches::createRenameDatafileDitch(
|
||||
TRI_datafile_t* datafile, void* data,
|
||||
std::function<void(struct TRI_datafile_t*, void*)> callback,
|
||||
std::function<void(struct TRI_datafile_t*, void*)> const& callback,
|
||||
char const* filename, int line) {
|
||||
try {
|
||||
auto ditch =
|
||||
|
@ -455,7 +455,7 @@ RenameDatafileDitch* Ditches::createRenameDatafileDitch(
|
|||
|
||||
UnloadCollectionDitch* Ditches::createUnloadCollectionDitch(
|
||||
LogicalCollection* collection,
|
||||
std::function<bool(LogicalCollection*)> callback,
|
||||
std::function<bool(LogicalCollection*)> const& callback,
|
||||
char const* filename, int line) {
|
||||
try {
|
||||
auto ditch = new UnloadCollectionDitch(this, collection, callback,
|
||||
|
|
|
@ -181,7 +181,7 @@ class DropDatafileDitch : public Ditch {
|
|||
public:
|
||||
DropDatafileDitch(Ditches* ditches, struct TRI_datafile_t* datafile,
|
||||
LogicalCollection* collection,
|
||||
std::function<void(struct TRI_datafile_t*, LogicalCollection*)>,
|
||||
std::function<void(struct TRI_datafile_t*, LogicalCollection*)> const& callback,
|
||||
char const* filename, int line);
|
||||
|
||||
~DropDatafileDitch();
|
||||
|
@ -207,7 +207,7 @@ class RenameDatafileDitch : public Ditch {
|
|||
public:
|
||||
RenameDatafileDitch(Ditches* ditches, struct TRI_datafile_t* datafile,
|
||||
void* data,
|
||||
std::function<void(struct TRI_datafile_t*, void*)>,
|
||||
std::function<void(struct TRI_datafile_t*, void*)> const& callback,
|
||||
char const* filename, int line);
|
||||
|
||||
~RenameDatafileDitch();
|
||||
|
@ -233,7 +233,7 @@ class UnloadCollectionDitch : public Ditch {
|
|||
public:
|
||||
UnloadCollectionDitch(
|
||||
Ditches* ditches, LogicalCollection* collection,
|
||||
std::function<bool(LogicalCollection*)> callback,
|
||||
std::function<bool(LogicalCollection*)> const& callback,
|
||||
char const* filename, int line);
|
||||
|
||||
~UnloadCollectionDitch();
|
||||
|
@ -371,7 +371,7 @@ class Ditches {
|
|||
|
||||
DropDatafileDitch* createDropDatafileDitch(
|
||||
struct TRI_datafile_t* datafile, LogicalCollection* collection,
|
||||
std::function<void(struct TRI_datafile_t*, LogicalCollection*)> callback,
|
||||
std::function<void(struct TRI_datafile_t*, LogicalCollection*)> const& callback,
|
||||
char const* filename, int line);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -380,7 +380,7 @@ class Ditches {
|
|||
|
||||
RenameDatafileDitch* createRenameDatafileDitch(
|
||||
struct TRI_datafile_t* datafile, void* data,
|
||||
std::function<void(struct TRI_datafile_t*, void*)> callback,
|
||||
std::function<void(struct TRI_datafile_t*, void*)> const& callback,
|
||||
char const* filename, int line);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -389,7 +389,7 @@ class Ditches {
|
|||
|
||||
UnloadCollectionDitch* createUnloadCollectionDitch(
|
||||
LogicalCollection* collection,
|
||||
std::function<bool(LogicalCollection*)> callback,
|
||||
std::function<bool(LogicalCollection*)> const& callback,
|
||||
char const* filename, int line);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Reference in New Issue