{"action":"created","comment":{"url":"https://api.github.com/repos/mapsme/omim/pulls/comments/43494674","id":43494674,"diff_hunk":"@@ -49,24 +77,26 @@ using OutgoingEdgeIteratorT = vector<OutgoingCrossNode>::const_iterator;\n /// Reader class from cross context section in mwm.routing file\n class CrossRoutingContextReader\n {\n-  vector<IngoingCrossNode> m_ingoingNodes;\n   vector<OutgoingCrossNode> m_outgoingNodes;\n   vector<string> m_neighborMwmList;\n-  unique_ptr<Reader> mp_reader = nullptr;\n+  vector<TWrittenEdgeWeight> m_adjacencyMatrix;\n+  m4::Tree<IngoingCrossNode> m_ingoingIndex;\n \n-  size_t GetIndexInAdjMatrix(IngoingEdgeIteratorT ingoing, OutgoingEdgeIteratorT outgoing) const;\n-\n-public:  \n+public:\n   void Load(Reader const & r);\n \n   const string & GetOutgoingMwmName(OutgoingCrossNode const & mwmIndex) const;\n \n-  pair<IngoingEdgeIteratorT, IngoingEdgeIteratorT> GetIngoingIterators() const;\n+  bool FindIngoingNodeByPoint(ms::LatLon const & point, IngoingCrossNode & node) const;\n \n-  pair<OutgoingEdgeIteratorT, OutgoingEdgeIteratorT> GetOutgoingIterators() const;\n+  TWrittenEdgeWeight GetAdjacencyCost(IngoingCrossNode const & ingoing,\n+                                     OutgoingCrossNode const & outgoing) const;\n+\n+  template <class TFunctor>\n+  void ForEachIngoingNode(TFunctor f) const {m_ingoingIndex.ForEach(f);}\n \n-  WritedEdgeWeightT GetAdjacencyCost(IngoingEdgeIteratorT ingoing,\n-                                     OutgoingEdgeIteratorT outgoing) const;\n+  template <class TFunctor>\n+  void ForEachOutgoingNode(TFunctor f) const {for_each(m_outgoingNodes.cbegin(), m_outgoingNodes.cend(), f);}","path":"routing/cross_routing_context.hpp","position":124,"original_position":124,"commit_id":"4ea126d0d9177ba0ba685007ebfad986f34c0c6e","original_commit_id":"4ea126d0d9177ba0ba685007ebfad986f34c0c6e","user":{"login":"vng","id":175612,"avatar_url":"https://avatars.githubusercontent.com/u/175612?v=3","gravatar_id":"","url":"https://api.github.com/users/vng","html_url":"https://github.com/vng","followers_url":"https://api.github.com/users/vng/followers","following_url":"https://api.github.com/users/vng/following{/other_user}","gists_url":"https://api.github.com/users/vng/gists{/gist_id}","starred_url":"https://api.github.com/users/vng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vng/subscriptions","organizations_url":"https://api.github.com/users/vng/orgs","repos_url":"https://api.github.com/users/vng/repos","events_url":"https://api.github.com/users/vng/events{/privacy}","received_events_url":"https://api.github.com/users/vng/received_events","type":"User","site_admin":false},"body":"Неужели так красиво в одну строку все? Тоже и для ForEachIngoingNode.","created_at":"2015-10-30T12:00:23Z","updated_at":"2015-10-30T12:00:23Z","html_url":"https://github.com/mapsme/omim/pull/352#discussion_r43494674","pull_request_url":"https://api.github.com/repos/mapsme/omim/pulls/352","_links":{"self":{"href":"https://api.github.com/repos/mapsme/omim/pulls/comments/43494674"},"html":{"href":"https://github.com/mapsme/omim/pull/352#discussion_r43494674"},"pull_request":{"href":"https://api.github.com/repos/mapsme/omim/pulls/352"}}},"pull_request":{"url":"https://api.github.com/repos/mapsme/omim/pulls/352","id":48468656,"html_url":"https://github.com/mapsme/omim/pull/352","diff_url":"https://github.com/mapsme/omim/pull/352.diff","patch_url":"https://github.com/mapsme/omim/pull/352.patch","issue_url":"https://api.github.com/repos/mapsme/omim/issues/352","number":352,"state":"open","locked":false,"title":"Tree index for a mwm cross point finding.","user":{"login":"gardster","id":1862559,"avatar_url":"https://avatars.githubusercontent.com/u/1862559?v=3","gravatar_id":"","url":"https://api.github.com/users/gardster","html_url":"https://github.com/gardster","followers_url":"https://api.github.com/users/gardster/followers","following_url":"https://api.github.com/users/gardster/following{/other_user}","gists_url":"https://api.github.com/users/gardster/gists{/gist_id}","starred_url":"https://api.github.com/users/gardster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gardster/subscriptions","organizations_url":"https://api.github.com/users/gardster/orgs","repos_url":"https://api.github.com/users/gardster/repos","events_url":"https://api.github.com/users/gardster/events{/privacy}","received_events_url":"https://api.github.com/users/gardster/received_events","type":"User","site_admin":false},"body":"Поиск соответствующей точки по ту сторону границы карты через дерево и рефакторинг всей подсистемы.\r\nhttps://trello.com/c/GhwPMKDV/2002-mwm\r\nНа тестах с маленькими mwm получилось значительно ускорить процесс нахождения маршрут через несколько mwm. со 130 секунд (Москва - Франция) до 50","created_at":"2015-10-22T14:59:56Z","updated_at":"2015-10-30T12:00:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5583fa2fc2d45c9f1b1f78e1849d9a03fa65b12f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mapsme/omim/pulls/352/commits","review_comments_url":"https://api.github.com/repos/mapsme/omim/pulls/352/comments","review_comment_url":"https://api.github.com/repos/mapsme/omim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mapsme/omim/issues/352/comments","statuses_url":"https://api.github.com/repos/mapsme/omim/statuses/4ea126d0d9177ba0ba685007ebfad986f34c0c6e","head":{"label":"gardster:cross_routing_speedup","ref":"cross_routing_speedup","sha":"4ea126d0d9177ba0ba685007ebfad986f34c0c6e","user":{"login":"gardster","id":1862559,"avatar_url":"https://avatars.githubusercontent.com/u/1862559?v=3","gravatar_id":"","url":"https://api.github.com/users/gardster","html_url":"https://github.com/gardster","followers_url":"https://api.github.com/users/gardster/followers","following_url":"https://api.github.com/users/gardster/following{/other_user}","gists_url":"https://api.github.com/users/gardster/gists{/gist_id}","starred_url":"https://api.github.com/users/gardster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gardster/subscriptions","organizations_url":"https://api.github.com/users/gardster/orgs","repos_url":"https://api.github.com/users/gardster/repos","events_url":"https://api.github.com/users/gardster/events{/privacy}","received_events_url":"https://api.github.com/users/gardster/received_events","type":"User","site_admin":false},"repo":{"id":43428017,"name":"omim","full_name":"gardster/omim","owner":{"login":"gardster","id":1862559,"avatar_url":"https://avatars.githubusercontent.com/u/1862559?v=3","gravatar_id":"","url":"https://api.github.com/users/gardster","html_url":"https://github.com/gardster","followers_url":"https://api.github.com/users/gardster/followers","following_url":"https://api.github.com/users/gardster/following{/other_user}","gists_url":"https://api.github.com/users/gardster/gists{/gist_id}","starred_url":"https://api.github.com/users/gardster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gardster/subscriptions","organizations_url":"https://api.github.com/users/gardster/orgs","repos_url":"https://api.github.com/users/gardster/repos","events_url":"https://api.github.com/users/gardster/events{/privacy}","received_events_url":"https://api.github.com/users/gardster/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gardster/omim","description":"MAPS.ME - Offline OpenStreetMap maps for iOS/Android/Mac/Linux/Windows","fork":true,"url":"https://api.github.com/repos/gardster/omim","forks_url":"https://api.github.com/repos/gardster/omim/forks","keys_url":"https://api.github.com/repos/gardster/omim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gardster/omim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gardster/omim/teams","hooks_url":"https://api.github.com/repos/gardster/omim/hooks","issue_events_url":"https://api.github.com/repos/gardster/omim/issues/events{/number}","events_url":"https://api.github.com/repos/gardster/omim/events","assignees_url":"https://api.github.com/repos/gardster/omim/assignees{/user}","branches_url":"https://api.github.com/repos/gardster/omim/branches{/branch}","tags_url":"https://api.github.com/repos/gardster/omim/tags","blobs_url":"https://api.github.com/repos/gardster/omim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gardster/omim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gardster/omim/git/refs{/sha}","trees_url":"https://api.github.com/repos/gardster/omim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gardster/omim/statuses/{sha}","languages_url":"https://api.github.com/repos/gardster/omim/languages","stargazers_url":"https://api.github.com/repos/gardster/omim/stargazers","contributors_url":"https://api.github.com/repos/gardster/omim/contributors","subscribers_url":"https://api.github.com/repos/gardster/omim/subscribers","subscription_url":"https://api.github.com/repos/gardster/omim/subscription","commits_url":"https://api.github.com/repos/gardster/omim/commits{/sha}","git_commits_url":"https://api.github.com/repos/gardster/omim/git/commits{/sha}","comments_url":"https://api.github.com/repos/gardster/omim/comments{/number}","issue_comment_url":"https://api.github.com/repos/gardster/omim/issues/comments{/number}","contents_url":"https://api.github.com/repos/gardster/omim/contents/{+path}","compare_url":"https://api.github.com/repos/gardster/omim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gardster/omim/merges","archive_url":"https://api.github.com/repos/gardster/omim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gardster/omim/downloads","issues_url":"https://api.github.com/repos/gardster/omim/issues{/number}","pulls_url":"https://api.github.com/repos/gardster/omim/pulls{/number}","milestones_url":"https://api.github.com/repos/gardster/omim/milestones{/number}","notifications_url":"https://api.github.com/repos/gardster/omim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gardster/omim/labels{/name}","releases_url":"https://api.github.com/repos/gardster/omim/releases{/id}","created_at":"2015-09-30T10:57:47Z","updated_at":"2015-09-30T10:59:59Z","pushed_at":"2015-10-30T07:33:25Z","git_url":"git://github.com/gardster/omim.git","ssh_url":"git@github.com:gardster/omim.git","clone_url":"https://github.com/gardster/omim.git","svn_url":"https://github.com/gardster/omim","homepage":null,"size":1815875,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mapsme:master","ref":"master","sha":"586ebdf5b63df8538c5e28559e390f6ca130047d","user":{"login":"mapsme","id":14185141,"avatar_url":"https://avatars.githubusercontent.com/u/14185141?v=3","gravatar_id":"","url":"https://api.github.com/users/mapsme","html_url":"https://github.com/mapsme","followers_url":"https://api.github.com/users/mapsme/followers","following_url":"https://api.github.com/users/mapsme/following{/other_user}","gists_url":"https://api.github.com/users/mapsme/gists{/gist_id}","starred_url":"https://api.github.com/users/mapsme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapsme/subscriptions","organizations_url":"https://api.github.com/users/mapsme/orgs","repos_url":"https://api.github.com/users/mapsme/repos","events_url":"https://api.github.com/users/mapsme/events{/privacy}","received_events_url":"https://api.github.com/users/mapsme/received_events","type":"Organization","site_admin":false},"repo":{"id":42798033,"name":"omim","full_name":"mapsme/omim","owner":{"login":"mapsme","id":14185141,"avatar_url":"https://avatars.githubusercontent.com/u/14185141?v=3","gravatar_id":"","url":"https://api.github.com/users/mapsme","html_url":"https://github.com/mapsme","followers_url":"https://api.github.com/users/mapsme/followers","following_url":"https://api.github.com/users/mapsme/following{/other_user}","gists_url":"https://api.github.com/users/mapsme/gists{/gist_id}","starred_url":"https://api.github.com/users/mapsme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapsme/subscriptions","organizations_url":"https://api.github.com/users/mapsme/orgs","repos_url":"https://api.github.com/users/mapsme/repos","events_url":"https://api.github.com/users/mapsme/events{/privacy}","received_events_url":"https://api.github.com/users/mapsme/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapsme/omim","description":"MAPS.ME - Offline OpenStreetMap maps for iOS/Android/Mac/Linux/Windows","fork":false,"url":"https://api.github.com/repos/mapsme/omim","forks_url":"https://api.github.com/repos/mapsme/omim/forks","keys_url":"https://api.github.com/repos/mapsme/omim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapsme/omim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapsme/omim/teams","hooks_url":"https://api.github.com/repos/mapsme/omim/hooks","issue_events_url":"https://api.github.com/repos/mapsme/omim/issues/events{/number}","events_url":"https://api.github.com/repos/mapsme/omim/events","assignees_url":"https://api.github.com/repos/mapsme/omim/assignees{/user}","branches_url":"https://api.github.com/repos/mapsme/omim/branches{/branch}","tags_url":"https://api.github.com/repos/mapsme/omim/tags","blobs_url":"https://api.github.com/repos/mapsme/omim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapsme/omim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapsme/omim/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapsme/omim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapsme/omim/statuses/{sha}","languages_url":"https://api.github.com/repos/mapsme/omim/languages","stargazers_url":"https://api.github.com/repos/mapsme/omim/stargazers","contributors_url":"https://api.github.com/repos/mapsme/omim/contributors","subscribers_url":"https://api.github.com/repos/mapsme/omim/subscribers","subscription_url":"https://api.github.com/repos/mapsme/omim/subscription","commits_url":"https://api.github.com/repos/mapsme/omim/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapsme/omim/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapsme/omim/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapsme/omim/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapsme/omim/contents/{+path}","compare_url":"https://api.github.com/repos/mapsme/omim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapsme/omim/merges","archive_url":"https://api.github.com/repos/mapsme/omim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapsme/omim/downloads","issues_url":"https://api.github.com/repos/mapsme/omim/issues{/number}","pulls_url":"https://api.github.com/repos/mapsme/omim/pulls{/number}","milestones_url":"https://api.github.com/repos/mapsme/omim/milestones{/number}","notifications_url":"https://api.github.com/repos/mapsme/omim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapsme/omim/labels{/name}","releases_url":"https://api.github.com/repos/mapsme/omim/releases{/id}","created_at":"2015-09-20T02:57:13Z","updated_at":"2015-10-30T05:17:00Z","pushed_at":"2015-10-30T11:39:34Z","git_url":"git://github.com/mapsme/omim.git","ssh_url":"git@github.com:mapsme/omim.git","clone_url":"https://github.com/mapsme/omim.git","svn_url":"https://github.com/mapsme/omim","homepage":null,"size":1880796,"stargazers_count":1434,"watchers_count":1434,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":158,"mirror_url":null,"open_issues_count":49,"forks":158,"open_issues":49,"watchers":1434,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mapsme/omim/pulls/352"},"html":{"href":"https://github.com/mapsme/omim/pull/352"},"issue":{"href":"https://api.github.com/repos/mapsme/omim/issues/352"},"comments":{"href":"https://api.github.com/repos/mapsme/omim/issues/352/comments"},"review_comments":{"href":"https://api.github.com/repos/mapsme/omim/pulls/352/comments"},"review_comment":{"href":"https://api.github.com/repos/mapsme/omim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mapsme/omim/pulls/352/commits"},"statuses":{"href":"https://api.github.com/repos/mapsme/omim/statuses/4ea126d0d9177ba0ba685007ebfad986f34c0c6e"}}}}