[ios] Performance optimizations.

This commit is contained in:
Ilya Grechuhin 2016-03-14 15:55:25 +03:00 committed by Sergey Yershov
parent 2c6b20a57d
commit 8ca688dffe
3 changed files with 11 additions and 11 deletions

View file

@ -203,9 +203,9 @@ extern NSString * const kSearchStateKey = @"SearchStateKey";
{
using namespace storage;
[self updateTopController];
NodeAttrs attrs;
GetFramework().Storage().GetNodeAttrs(countryId, attrs);
if (attrs.m_status == NodeStatus::Error)
NodeStatuses nodeStatuses{};
GetFramework().Storage().GetNodeStatuses(countryId, nodeStatuses);
if (nodeStatuses.m_status == NodeStatus::Error)
[self.downloadController setDownloadFailed];
if (self.state == MWMSearchManagerStateTableSearch || self.state == MWMSearchManagerStateMapSearch)
{

View file

@ -655,11 +655,11 @@ NSString * const kReportSegue = @"Map2ReportSegue";
- (void)processCountryEvent:(TCountryId const &)countryId
{
storage::NodeAttrs nodeAttrs;
GetFramework().Storage().GetNodeAttrs(countryId, nodeAttrs);
if (nodeAttrs.m_status != NodeStatus::Error)
NodeStatuses nodeStatuses{};
GetFramework().Storage().GetNodeStatuses(countryId, nodeStatuses);
if (nodeStatuses.m_status != NodeStatus::Error)
return;
switch (nodeAttrs.m_error)
switch (nodeStatuses.m_error)
{
case NodeErrorCode::NoError:
break;

View file

@ -76,16 +76,16 @@ using namespace storage;
return;
auto & f = GetFramework();
auto s = f.Storage().GetPrefetchStorage();
NodeAttrs nodeAttrs;
s->GetNodeAttrs(countryId, nodeAttrs);
switch (nodeAttrs.m_status)
NodeStatuses nodeStatuses{};
s->GetNodeStatuses(countryId, nodeStatuses);
switch (nodeStatuses.m_status)
{
case NodeStatus::OnDisk:
migrate();
break;
case NodeStatus::Undefined:
case NodeStatus::Error:
[self showError:nodeAttrs.m_error countryId:countryId]; break;
[self showError:nodeStatuses.m_error countryId:countryId]; break;
default:
break;
}