@@ -183,16 +183,15 @@ struct EdgeConstraints
183183 }
184184
185185 std::shared_ptr<_Connection> operator ()(const std::optional<int >& first,
186- const std::optional<response::Value>& after, const std::optional<int >& last,
187- const std::optional<response::Value>& before) const
186+ std::optional<response::Value>& & after, const std::optional<int >& last,
187+ std::optional<response::Value>& & before) const
188188 {
189189 auto itrFirst = _objects.cbegin ();
190190 auto itrLast = _objects.cend ();
191191
192192 if (after)
193193 {
194- const auto & encoded = after->get <response::StringType>();
195- auto afterId = service::Base64::fromBase64 (encoded.c_str (), encoded.size ());
194+ auto afterId = after->release <response::IdType>();
196195 auto itrAfter =
197196 std::find_if (itrFirst, itrLast, [&afterId](const std::shared_ptr<_Object>& entry) {
198197 return entry->id () == afterId;
@@ -206,8 +205,7 @@ struct EdgeConstraints
206205
207206 if (before)
208207 {
209- const auto & encoded = before->get <response::StringType>();
210- auto beforeId = service::Base64::fromBase64 (encoded.c_str (), encoded.size ());
208+ auto beforeId = before->release <response::IdType>();
211209 auto itrBefore =
212210 std::find_if (itrFirst, itrLast, [&beforeId](const std::shared_ptr<_Object>& entry) {
213211 return entry->id () == beforeId;
@@ -281,7 +279,7 @@ service::FieldResult<std::shared_ptr<object::AppointmentConnection>> Query::getA
281279 loadAppointments (state);
282280
283281 EdgeConstraints<Appointment, AppointmentConnection> constraints (state, _appointments);
284- auto connection = constraints (firstWrapped, afterWrapped, lastWrapped, beforeWrapped);
282+ auto connection = constraints (firstWrapped, std::move ( afterWrapped) , lastWrapped, std::move ( beforeWrapped) );
285283
286284 return std::static_pointer_cast<object::AppointmentConnection>(connection);
287285 },
@@ -307,7 +305,7 @@ service::FieldResult<std::shared_ptr<object::TaskConnection>> Query::getTasks(
307305 loadTasks (state);
308306
309307 EdgeConstraints<Task, TaskConnection> constraints (state, _tasks);
310- auto connection = constraints (firstWrapped, afterWrapped, lastWrapped, beforeWrapped);
308+ auto connection = constraints (firstWrapped, std::move ( afterWrapped) , lastWrapped, std::move ( beforeWrapped) );
311309
312310 return std::static_pointer_cast<object::TaskConnection>(connection);
313311 },
@@ -333,7 +331,7 @@ service::FieldResult<std::shared_ptr<object::FolderConnection>> Query::getUnread
333331 loadUnreadCounts (state);
334332
335333 EdgeConstraints<Folder, FolderConnection> constraints (state, _unreadCounts);
336- auto connection = constraints (firstWrapped, afterWrapped, lastWrapped, beforeWrapped);
334+ auto connection = constraints (firstWrapped, std::move ( afterWrapped) , lastWrapped, std::move ( beforeWrapped) );
337335
338336 return std::static_pointer_cast<object::FolderConnection>(connection);
339337 },
0 commit comments