Have `Results` default its copy constructor.

The custom implementation was an attempt to ensure that
`m_has_used_table_view` and `m_wants_background_updates` had appropriate
intial values. Thomas pointed out that we can remove the reliance on the
initial values by ensure that `prepare_async` sets
`m_wants_background_updates`, removing the need for a custom copy
constructor.
This commit is contained in:
Mark Rowe 2016-06-01 11:48:35 -07:00
parent 2a75edde8e
commit 3e952269da
1 changed files with 2 additions and 15 deletions

View File

@ -86,21 +86,7 @@ Results::Results(SharedRealm r, const ObjectSchema& o, TableView tv, SortOrder s
REALM_ASSERT(m_sort.column_indices.size() == m_sort.ascending.size()); REALM_ASSERT(m_sort.column_indices.size() == m_sort.ascending.size());
} }
Results::Results(const Results& other) Results::Results(const Results& other) = default;
: m_realm(other.m_realm)
, m_object_schema(other.m_object_schema)
, m_query(other.m_query)
, m_table_view(other.m_table_view)
, m_link_view(other.m_link_view)
, m_table(other.m_table)
, m_sort(other.m_sort)
, m_live(other.m_live)
, m_notifier()
, m_mode(other.m_mode)
, m_has_used_table_view(false)
, m_wants_background_updates(true)
{
}
#if 0 #if 0
// FIXME: TableViewBase::operator= is missing from the core static library. // FIXME: TableViewBase::operator= is missing from the core static library.
@ -538,6 +524,7 @@ void Results::prepare_async()
} }
if (!m_notifier) { if (!m_notifier) {
m_wants_background_updates = true;
m_notifier = std::make_shared<_impl::ResultsNotifier>(*this); m_notifier = std::make_shared<_impl::ResultsNotifier>(*this);
_impl::RealmCoordinator::register_notifier(m_notifier); _impl::RealmCoordinator::register_notifier(m_notifier);
} }