diff --git a/arangod/Agency/AgencyCommon.h b/arangod/Agency/AgencyCommon.h index 2bc4e7f911..0eb660c7fd 100644 --- a/arangod/Agency/AgencyCommon.h +++ b/arangod/Agency/AgencyCommon.h @@ -63,7 +63,7 @@ struct read_ret_t { std::string redirect; ///< @brief If not accepted redirect id std::vector success; ///< @brief Query's precond OK query_t result; ///< @brief Query result - read_ret_t(bool a, std::string id, std::vector suc = std::vector(), + read_ret_t(bool a, std::string const& id, std::vector const& suc = std::vector(), query_t res = nullptr) : accepted(a), redirect(id), success(suc), result(res) {} }; @@ -76,8 +76,8 @@ struct write_ret_t { std::vector applied; std::vector 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 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 const& app, std::vector const& idx) : accepted(a), redirect(id), applied(app), indices(idx) {} }; diff --git a/arangod/Agency/NotifyCallback.cpp b/arangod/Agency/NotifyCallback.cpp index c7781e719f..364ff9b14f 100644 --- a/arangod/Agency/NotifyCallback.cpp +++ b/arangod/Agency/NotifyCallback.cpp @@ -25,7 +25,7 @@ using namespace arangodb::consensus; -NotifyCallback::NotifyCallback(std::function cb) : _cb(cb) {} +NotifyCallback::NotifyCallback(std::function const& cb) : _cb(cb) {} bool NotifyCallback::operator()(arangodb::ClusterCommResult* res) { _cb(res->status == CL_COMM_SENT && res->result->getHttpReturnCode() == 200); diff --git a/arangod/Agency/NotifyCallback.h b/arangod/Agency/NotifyCallback.h index 80aefc0304..ff0fa0bce0 100644 --- a/arangod/Agency/NotifyCallback.h +++ b/arangod/Agency/NotifyCallback.h @@ -34,7 +34,7 @@ namespace consensus { class NotifyCallback : public arangodb::ClusterCommCallback { public: - explicit NotifyCallback(std::function); + explicit NotifyCallback(std::function const&); virtual bool operator()(arangodb::ClusterCommResult*) override final; diff --git a/arangod/Agency/Supervision.h b/arangod/Agency/Supervision.h index 96d62f75e5..b2c0e0a96b 100644 --- a/arangod/Agency/Supervision.h +++ b/arangod/Agency/Supervision.h @@ -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; diff --git a/arangod/Aql/Optimizer.h b/arangod/Aql/Optimizer.h index 1cbdffb100..f58111b5b8 100644 --- a/arangod/Aql/Optimizer.h +++ b/arangod/Aql/Optimizer.h @@ -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); } diff --git a/arangod/Aql/ShortestPathNode.cpp b/arangod/Aql/ShortestPathNode.cpp index 1fa68909cb..8291d9071f 100644 --- a/arangod/Aql/ShortestPathNode.cpp +++ b/arangod/Aql/ShortestPathNode.cpp @@ -160,7 +160,7 @@ ShortestPathNode::ShortestPathNode(ExecutionPlan* plan, size_t id, ShortestPathNode::ShortestPathNode(ExecutionPlan* plan, size_t id, TRI_vocbase_t* vocbase, std::vector const& edgeColls, - std::vector directions, + std::vector const& directions, Variable const* inStartVariable, std::string const& startVertexId, Variable const* inTargetVariable, diff --git a/arangod/Aql/ShortestPathNode.h b/arangod/Aql/ShortestPathNode.h index 91cbc8318c..daa72e493a 100644 --- a/arangod/Aql/ShortestPathNode.h +++ b/arangod/Aql/ShortestPathNode.h @@ -56,7 +56,7 @@ class ShortestPathNode : public ExecutionNode { private: ShortestPathNode(ExecutionPlan* plan, size_t id, TRI_vocbase_t* vocbase, std::vector const& edgeColls, - std::vector directions, + std::vector const& directions, Variable const* inStartVariable, std::string const& startVertexId, Variable const* inTargetVariable, diff --git a/arangod/Aql/TraversalNode.cpp b/arangod/Aql/TraversalNode.cpp index b32a388399..f65e78c3a4 100644 --- a/arangod/Aql/TraversalNode.cpp +++ b/arangod/Aql/TraversalNode.cpp @@ -251,7 +251,7 @@ TraversalNode::TraversalNode(ExecutionPlan* plan, size_t id, TraversalNode::TraversalNode( ExecutionPlan* plan, size_t id, TRI_vocbase_t* vocbase, std::vector const& edgeColls, Variable const* inVariable, - std::string const& vertexId, std::vector directions, + std::string const& vertexId, std::vector const& directions, uint64_t minDepth, uint64_t maxDepth, TraversalOptions const& options) : ExecutionNode(plan, id), _vocbase(vocbase), diff --git a/arangod/Aql/TraversalNode.h b/arangod/Aql/TraversalNode.h index 90e177cc39..faf87c57d9 100644 --- a/arangod/Aql/TraversalNode.h +++ b/arangod/Aql/TraversalNode.h @@ -84,7 +84,7 @@ class TraversalNode : public ExecutionNode { TraversalNode(ExecutionPlan* plan, size_t id, TRI_vocbase_t* vocbase, std::vector const& edgeColls, Variable const* inVariable, std::string const& vertexId, - std::vector directions, uint64_t minDepth, + std::vector const& directions, uint64_t minDepth, uint64_t maxDepth, TraversalOptions const& options); public: diff --git a/arangod/Cluster/ClusterTraverser.h b/arangod/Cluster/ClusterTraverser.h index e2cf495f21..01f40bbcbb 100644 --- a/arangod/Cluster/ClusterTraverser.h +++ b/arangod/Cluster/ClusterTraverser.h @@ -39,7 +39,7 @@ class ClusterTraverser final : public Traverser { public: ClusterTraverser( - std::vector edgeCollections, TraverserOptions& opts, + std::vector const& edgeCollections, TraverserOptions& opts, std::string const& dbname, Transaction* trx) : Traverser(opts), _edgeCols(edgeCollections), diff --git a/arangod/Indexes/SkiplistIndex.h b/arangod/Indexes/SkiplistIndex.h index 5494ec81d6..f6f1142bf1 100644 --- a/arangod/Indexes/SkiplistIndex.h +++ b/arangod/Indexes/SkiplistIndex.h @@ -253,7 +253,7 @@ class SkiplistIterator2 : public IndexIterator { SkiplistIterator2( TRI_Skiplist const* skiplist, std::function CmpElmElm, + arangodb::basics::SkipListCmpType)> const& CmpElmElm, bool reverse, BaseSkiplistLookupBuilder* builder) : _skiplistIndex(skiplist), _reverse(reverse), diff --git a/arangod/VocBase/Ditch.cpp b/arangod/VocBase/Ditch.cpp index e34ca459b1..3b669095d5 100644 --- a/arangod/VocBase/Ditch.cpp +++ b/arangod/VocBase/Ditch.cpp @@ -85,7 +85,7 @@ CompactionDitch::~CompactionDitch() {} DropDatafileDitch::DropDatafileDitch( Ditches* ditches, TRI_datafile_t* datafile, LogicalCollection* collection, - std::function callback, char const* filename, + std::function 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 callback, char const* filename, + std::function 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 callback, + std::function 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 callback, + std::function 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 callback, + std::function const& callback, char const* filename, int line) { try { auto ditch = @@ -455,7 +455,7 @@ RenameDatafileDitch* Ditches::createRenameDatafileDitch( UnloadCollectionDitch* Ditches::createUnloadCollectionDitch( LogicalCollection* collection, - std::function callback, + std::function const& callback, char const* filename, int line) { try { auto ditch = new UnloadCollectionDitch(this, collection, callback, diff --git a/arangod/VocBase/Ditch.h b/arangod/VocBase/Ditch.h index 9bfb3e00bc..680ca212ab 100644 --- a/arangod/VocBase/Ditch.h +++ b/arangod/VocBase/Ditch.h @@ -181,7 +181,7 @@ class DropDatafileDitch : public Ditch { public: DropDatafileDitch(Ditches* ditches, struct TRI_datafile_t* datafile, LogicalCollection* collection, - std::function, + std::function 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, + std::function const& callback, char const* filename, int line); ~RenameDatafileDitch(); @@ -233,7 +233,7 @@ class UnloadCollectionDitch : public Ditch { public: UnloadCollectionDitch( Ditches* ditches, LogicalCollection* collection, - std::function callback, + std::function 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 callback, + std::function const& callback, char const* filename, int line); ////////////////////////////////////////////////////////////////////////////// @@ -380,7 +380,7 @@ class Ditches { RenameDatafileDitch* createRenameDatafileDitch( struct TRI_datafile_t* datafile, void* data, - std::function callback, + std::function const& callback, char const* filename, int line); ////////////////////////////////////////////////////////////////////////////// @@ -389,7 +389,7 @@ class Ditches { UnloadCollectionDitch* createUnloadCollectionDitch( LogicalCollection* collection, - std::function callback, + std::function const& callback, char const* filename, int line); //////////////////////////////////////////////////////////////////////////////