From 4e18a99dfdc17f10306818d932b889bb3199b9ea Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Mon, 1 Feb 2016 06:44:27 -0800 Subject: [PATCH] Update some out-of-date comments --- src/impl/async_query.cpp | 3 +++ src/impl/async_query.hpp | 11 ++++------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/impl/async_query.cpp b/src/impl/async_query.cpp index 4418dcf6..efb03699 100644 --- a/src/impl/async_query.cpp +++ b/src/impl/async_query.cpp @@ -183,6 +183,9 @@ void AsyncQuery::prepare_handover() m_initial_run_complete = true; m_handed_over_table_version = m_tv.outside_version(); m_tv_handover = m_sg->export_for_handover(m_tv, MutableSourcePayload::Move); + + // detach the TableView as we won't need it again and keeping it around + // makes advance_read() much more expensive m_tv = TableView(); } diff --git a/src/impl/async_query.hpp b/src/impl/async_query.hpp index efc938c5..3f643d39 100644 --- a/src/impl/async_query.hpp +++ b/src/impl/async_query.hpp @@ -72,15 +72,12 @@ private: const SortOrder m_sort; const std::thread::id m_thread_id = std::this_thread::get_id(); - // The source Query, in handover from iff m_sg is null - // Only used until the first time the query is actually run, after which - // both will be null + // The source Query, in handover form iff m_sg is null std::unique_ptr> m_query_handover; std::unique_ptr m_query; - // The TableView resulting from running the query. Will be detached if the - // Query has not yet been run, in which case m_query or m_query_handover will - // be non-null + // The TableView resulting from running the query. Will be detached unless + // the query was (re)run since the last time the handover object was created TableView m_tv; std::unique_ptr> m_tv_handover; SharedGroup::VersionID m_sg_version; @@ -93,7 +90,7 @@ private: }; // Currently registered callbacks and a mutex which must always be held - // while doing anything with them + // while doing anything with them or m_callback_index std::mutex m_callback_mutex; std::vector m_callbacks;