Used the move semantics in constructing QueryProcessor.
Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/24367d7d Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/24367d7d Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/24367d7d Branch: refs/heads/min-max-stats Commit: 24367d7d878e066ce131a6e13032b2ba0ecef8f7 Parents: dec8723 Author: Zuyu Zhang <zu...@apache.org> Authored: Fri Nov 18 23:28:34 2016 -0800 Committer: Zuyu Zhang <zu...@apache.org> Committed: Sun Nov 20 19:25:55 2016 -0800 ---------------------------------------------------------------------- cli/QuickstepCli.cpp | 2 +- query_optimizer/QueryProcessor.hpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/24367d7d/cli/QuickstepCli.cpp ---------------------------------------------------------------------- diff --git a/cli/QuickstepCli.cpp b/cli/QuickstepCli.cpp index 31215f6..f17e18b 100644 --- a/cli/QuickstepCli.cpp +++ b/cli/QuickstepCli.cpp @@ -285,7 +285,7 @@ int main(int argc, char* argv[]) { // Setup QueryProcessor, including CatalogDatabase. std::unique_ptr<QueryProcessor> query_processor; try { - query_processor = std::make_unique<QueryProcessor>(catalog_path); + query_processor = std::make_unique<QueryProcessor>(std::move(catalog_path)); } catch (const std::exception &e) { LOG(FATAL) << "FATAL ERROR DURING STARTUP: " << e.what() http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/24367d7d/query_optimizer/QueryProcessor.hpp ---------------------------------------------------------------------- diff --git a/query_optimizer/QueryProcessor.hpp b/query_optimizer/QueryProcessor.hpp index 5e5c115..3e37c9d 100644 --- a/query_optimizer/QueryProcessor.hpp +++ b/query_optimizer/QueryProcessor.hpp @@ -24,6 +24,7 @@ #include <exception> #include <memory> #include <string> +#include <utility> #include "catalog/Catalog.hpp" #include "query_optimizer/Optimizer.hpp" @@ -130,8 +131,8 @@ class QueryProcessor { * * @param catalog_filename The file to read the serialized catalog from. **/ - explicit QueryProcessor(const std::string &catalog_filename) - : catalog_filename_(catalog_filename), + explicit QueryProcessor(std::string &&catalog_filename) + : catalog_filename_(std::move(catalog_filename)), catalog_altered_(false), query_id_(0) { loadCatalog(); @@ -185,7 +186,7 @@ class QueryProcessor { optimizer::Optimizer optimizer_; - std::string catalog_filename_; + const std::string catalog_filename_; std::unique_ptr<Catalog> catalog_;