From c2671d7ba3da4d06ac712a5156a2da98c4057a92 Mon Sep 17 00:00:00 2001 From: jsteemann Date: Fri, 3 Feb 2017 16:51:41 +0100 Subject: [PATCH] micro optimizations --- arangod/Aql/BasicBlocks.h | 10 +++++----- arangod/Aql/CalculationBlock.h | 2 +- arangod/Aql/CollectBlock.h | 2 +- arangod/Aql/EnumerateCollectionBlock.h | 2 +- arangod/Aql/ExecutionNode.cpp | 2 +- arangod/Aql/ExecutionNode.h | 4 ++-- arangod/Aql/IndexBlock.h | 2 +- arangod/Aql/SortBlock.h | 2 +- arangod/Aql/TraversalBlock.h | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/arangod/Aql/BasicBlocks.h b/arangod/Aql/BasicBlocks.h index 9b71b03ede..639422295b 100644 --- a/arangod/Aql/BasicBlocks.h +++ b/arangod/Aql/BasicBlocks.h @@ -35,7 +35,7 @@ class AqlItemBlock; class ExecutionEngine; -class SingletonBlock : public ExecutionBlock { +class SingletonBlock final : public ExecutionBlock { public: SingletonBlock(ExecutionEngine* engine, SingletonNode const* ep) : ExecutionBlock(engine, ep), _inputRegisterValues(nullptr), _whitelistBuilt(false) {} @@ -75,7 +75,7 @@ class SingletonBlock : public ExecutionBlock { bool _whitelistBuilt; }; -class FilterBlock : public ExecutionBlock { +class FilterBlock final : public ExecutionBlock { public: FilterBlock(ExecutionEngine*, FilterNode const*); @@ -112,7 +112,7 @@ class FilterBlock : public ExecutionBlock { BlockCollector _collector; }; -class LimitBlock : public ExecutionBlock { +class LimitBlock final : public ExecutionBlock { public: LimitBlock(ExecutionEngine* engine, LimitNode const* ep) : ExecutionBlock(engine, ep), @@ -145,7 +145,7 @@ class LimitBlock : public ExecutionBlock { bool const _fullCount; }; -class ReturnBlock : public ExecutionBlock { +class ReturnBlock final : public ExecutionBlock { public: ReturnBlock(ExecutionEngine* engine, ReturnNode const* ep) : ExecutionBlock(engine, ep), _returnInheritedResults(false) {} @@ -168,7 +168,7 @@ class ReturnBlock : public ExecutionBlock { bool _returnInheritedResults; }; -class NoResultsBlock : public ExecutionBlock { +class NoResultsBlock final : public ExecutionBlock { public: NoResultsBlock(ExecutionEngine* engine, NoResultsNode const* ep) : ExecutionBlock(engine, ep) {} diff --git a/arangod/Aql/CalculationBlock.h b/arangod/Aql/CalculationBlock.h index 9ea9ac1367..4f48a718fd 100644 --- a/arangod/Aql/CalculationBlock.h +++ b/arangod/Aql/CalculationBlock.h @@ -34,7 +34,7 @@ class AqlItemBlock; class ExecutionEngine; -class CalculationBlock : public ExecutionBlock { +class CalculationBlock final : public ExecutionBlock { public: CalculationBlock(ExecutionEngine*, CalculationNode const*); diff --git a/arangod/Aql/CollectBlock.h b/arangod/Aql/CollectBlock.h index af0020de5b..60041af5da 100644 --- a/arangod/Aql/CollectBlock.h +++ b/arangod/Aql/CollectBlock.h @@ -43,7 +43,7 @@ class ExecutionEngine; typedef std::vector AggregateValuesType; -class SortedCollectBlock : public ExecutionBlock { +class SortedCollectBlock final : public ExecutionBlock { private: typedef std::vector AggregateValuesType; diff --git a/arangod/Aql/EnumerateCollectionBlock.h b/arangod/Aql/EnumerateCollectionBlock.h index c26229bb4b..5fc4a30684 100644 --- a/arangod/Aql/EnumerateCollectionBlock.h +++ b/arangod/Aql/EnumerateCollectionBlock.h @@ -41,7 +41,7 @@ struct Collection; class CollectionScanner; class ExecutionEngine; -class EnumerateCollectionBlock : public ExecutionBlock { +class EnumerateCollectionBlock final : public ExecutionBlock { public: EnumerateCollectionBlock(ExecutionEngine* engine, EnumerateCollectionNode const* ep); diff --git a/arangod/Aql/ExecutionNode.cpp b/arangod/Aql/ExecutionNode.cpp index 3248002d7e..ead2f1a99c 100644 --- a/arangod/Aql/ExecutionNode.cpp +++ b/arangod/Aql/ExecutionNode.cpp @@ -1139,7 +1139,7 @@ void ExecutionNode::RegisterPlan::after(ExecutionNode* en) { regsToClear.emplace(r); } } - en->setRegsToClear(regsToClear); + en->setRegsToClear(std::move(regsToClear)); } } diff --git a/arangod/Aql/ExecutionNode.h b/arangod/Aql/ExecutionNode.h index 6a53a82a32..bf06453060 100644 --- a/arangod/Aql/ExecutionNode.h +++ b/arangod/Aql/ExecutionNode.h @@ -586,8 +586,8 @@ class ExecutionNode { void toVelocyPackHelperGeneric(arangodb::velocypack::Builder&, bool) const; /// @brief set regs to be deleted - void setRegsToClear(std::unordered_set const& toClear) { - _regsToClear = toClear; + void setRegsToClear(std::unordered_set&& toClear) { + _regsToClear = std::move(toClear); } protected: diff --git a/arangod/Aql/IndexBlock.h b/arangod/Aql/IndexBlock.h index 1de0cd69d5..8eb1ddc55f 100644 --- a/arangod/Aql/IndexBlock.h +++ b/arangod/Aql/IndexBlock.h @@ -59,7 +59,7 @@ struct NonConstExpression { ~NonConstExpression() { delete expression; } }; -class IndexBlock : public ExecutionBlock { +class IndexBlock final : public ExecutionBlock { public: IndexBlock(ExecutionEngine* engine, IndexNode const* ep); diff --git a/arangod/Aql/SortBlock.h b/arangod/Aql/SortBlock.h index fc9cfa498f..0ece04380b 100644 --- a/arangod/Aql/SortBlock.h +++ b/arangod/Aql/SortBlock.h @@ -37,7 +37,7 @@ class AqlItemBlock; class ExecutionEngine; -class SortBlock : public ExecutionBlock { +class SortBlock final : public ExecutionBlock { public: SortBlock(ExecutionEngine*, SortNode const*); diff --git a/arangod/Aql/TraversalBlock.h b/arangod/Aql/TraversalBlock.h index 267e5147ea..4b27a7a865 100644 --- a/arangod/Aql/TraversalBlock.h +++ b/arangod/Aql/TraversalBlock.h @@ -37,7 +37,7 @@ class ManagedDocumentResult; namespace aql { -class TraversalBlock : public ExecutionBlock { +class TraversalBlock final : public ExecutionBlock { public: TraversalBlock(ExecutionEngine* engine, TraversalNode const* ep);