{"action":"created","comment":{"url":"https://api.github.com/repos/realm/realm-core/pulls/comments/82149915","pull_request_review_id":3076285,"id":82149915,"diff_hunk":"@@ -757,30 +757,34 @@ void Array::set_all_to_zero()\n \n void Array::adjust_ge(int_fast64_t limit, int_fast64_t diff)\n {\n-    for (size_t i = 0, n = size(); i != n;) {\n-        REALM_TEMPEX(i = adjust_ge, m_width, (i, n, limit, diff))\n+    if (diff != 0) {\n+        for (size_t i = 0, n = size(); i != n;) {\n+            REALM_TEMPEX(i = adjust_ge, m_width, (i, n, limit, diff))\n+        }\n     }\n }\n \n template <size_t w>\n size_t Array::adjust_ge(size_t start, size_t end, int_fast64_t limit, int_fast64_t diff)\n {\n-    // Check if we need to copy before modifying\n-    copy_on_write(); // Throws\n+    if (diff != 0) {","path":"src/realm/array.cpp","position":18,"original_position":18,"commit_id":"3be4e871f0815c69d6698a9a9a7a8caa2ac984c9","original_commit_id":"3be4e871f0815c69d6698a9a9a7a8caa2ac984c9","user":{"login":"bmunkholm","id":1215687,"avatar_url":"https://avatars.githubusercontent.com/u/1215687?v=3","gravatar_id":"","url":"https://api.github.com/users/bmunkholm","html_url":"https://github.com/bmunkholm","followers_url":"https://api.github.com/users/bmunkholm/followers","following_url":"https://api.github.com/users/bmunkholm/following{/other_user}","gists_url":"https://api.github.com/users/bmunkholm/gists{/gist_id}","starred_url":"https://api.github.com/users/bmunkholm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmunkholm/subscriptions","organizations_url":"https://api.github.com/users/bmunkholm/orgs","repos_url":"https://api.github.com/users/bmunkholm/repos","events_url":"https://api.github.com/users/bmunkholm/events{/privacy}","received_events_url":"https://api.github.com/users/bmunkholm/received_events","type":"User","site_admin":false},"body":"👍 ","created_at":"2016-10-06T09:32:55Z","updated_at":"2016-10-06T09:32:55Z","html_url":"https://github.com/realm/realm-core/pull/2240#discussion_r82149915","pull_request_url":"https://api.github.com/repos/realm/realm-core/pulls/2240","_links":{"self":{"href":"https://api.github.com/repos/realm/realm-core/pulls/comments/82149915"},"html":{"href":"https://github.com/realm/realm-core/pull/2240#discussion_r82149915"},"pull_request":{"href":"https://api.github.com/repos/realm/realm-core/pulls/2240"}}},"pull_request":{"url":"https://api.github.com/repos/realm/realm-core/pulls/2240","id":88095235,"html_url":"https://github.com/realm/realm-core/pull/2240","diff_url":"https://github.com/realm/realm-core/pull/2240.diff","patch_url":"https://github.com/realm/realm-core/pull/2240.patch","issue_url":"https://api.github.com/repos/realm/realm-core/issues/2240","number":2240,"state":"open","locked":false,"title":"Optimize Array::adjust","user":{"login":"jedelbo","id":572755,"avatar_url":"https://avatars.githubusercontent.com/u/572755?v=3","gravatar_id":"","url":"https://api.github.com/users/jedelbo","html_url":"https://github.com/jedelbo","followers_url":"https://api.github.com/users/jedelbo/followers","following_url":"https://api.github.com/users/jedelbo/following{/other_user}","gists_url":"https://api.github.com/users/jedelbo/gists{/gist_id}","starred_url":"https://api.github.com/users/jedelbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jedelbo/subscriptions","organizations_url":"https://api.github.com/users/jedelbo/orgs","repos_url":"https://api.github.com/users/jedelbo/repos","events_url":"https://api.github.com/users/jedelbo/events{/privacy}","received_events_url":"https://api.github.com/users/jedelbo/received_events","type":"User","site_admin":false},"body":"Relates to #2239 ","created_at":"2016-10-05T15:00:15Z","updated_at":"2016-10-06T09:32:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"931b04f08c29c0b909d2b53f86434ffd274b76d9","assignee":{"login":"jedelbo","id":572755,"avatar_url":"https://avatars.githubusercontent.com/u/572755?v=3","gravatar_id":"","url":"https://api.github.com/users/jedelbo","html_url":"https://github.com/jedelbo","followers_url":"https://api.github.com/users/jedelbo/followers","following_url":"https://api.github.com/users/jedelbo/following{/other_user}","gists_url":"https://api.github.com/users/jedelbo/gists{/gist_id}","starred_url":"https://api.github.com/users/jedelbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jedelbo/subscriptions","organizations_url":"https://api.github.com/users/jedelbo/orgs","repos_url":"https://api.github.com/users/jedelbo/repos","events_url":"https://api.github.com/users/jedelbo/events{/privacy}","received_events_url":"https://api.github.com/users/jedelbo/received_events","type":"User","site_admin":false},"assignees":[{"login":"jedelbo","id":572755,"avatar_url":"https://avatars.githubusercontent.com/u/572755?v=3","gravatar_id":"","url":"https://api.github.com/users/jedelbo","html_url":"https://github.com/jedelbo","followers_url":"https://api.github.com/users/jedelbo/followers","following_url":"https://api.github.com/users/jedelbo/following{/other_user}","gists_url":"https://api.github.com/users/jedelbo/gists{/gist_id}","starred_url":"https://api.github.com/users/jedelbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jedelbo/subscriptions","organizations_url":"https://api.github.com/users/jedelbo/orgs","repos_url":"https://api.github.com/users/jedelbo/repos","events_url":"https://api.github.com/users/jedelbo/events{/privacy}","received_events_url":"https://api.github.com/users/jedelbo/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/realm/realm-core/pulls/2240/commits","review_comments_url":"https://api.github.com/repos/realm/realm-core/pulls/2240/comments","review_comment_url":"https://api.github.com/repos/realm/realm-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/realm/realm-core/issues/2240/comments","statuses_url":"https://api.github.com/repos/realm/realm-core/statuses/3be4e871f0815c69d6698a9a9a7a8caa2ac984c9","head":{"label":"realm:jed/optimize-array-adjust","ref":"jed/optimize-array-adjust","sha":"3be4e871f0815c69d6698a9a9a7a8caa2ac984c9","user":{"login":"realm","id":7575099,"avatar_url":"https://avatars.githubusercontent.com/u/7575099?v=3","gravatar_id":"","url":"https://api.github.com/users/realm","html_url":"https://github.com/realm","followers_url":"https://api.github.com/users/realm/followers","following_url":"https://api.github.com/users/realm/following{/other_user}","gists_url":"https://api.github.com/users/realm/gists{/gist_id}","starred_url":"https://api.github.com/users/realm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/realm/subscriptions","organizations_url":"https://api.github.com/users/realm/orgs","repos_url":"https://api.github.com/users/realm/repos","events_url":"https://api.github.com/users/realm/events{/privacy}","received_events_url":"https://api.github.com/users/realm/received_events","type":"Organization","site_admin":false},"repo":{"id":1917262,"name":"realm-core","full_name":"realm/realm-core","owner":{"login":"realm","id":7575099,"avatar_url":"https://avatars.githubusercontent.com/u/7575099?v=3","gravatar_id":"","url":"https://api.github.com/users/realm","html_url":"https://github.com/realm","followers_url":"https://api.github.com/users/realm/followers","following_url":"https://api.github.com/users/realm/following{/other_user}","gists_url":"https://api.github.com/users/realm/gists{/gist_id}","starred_url":"https://api.github.com/users/realm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/realm/subscriptions","organizations_url":"https://api.github.com/users/realm/orgs","repos_url":"https://api.github.com/users/realm/repos","events_url":"https://api.github.com/users/realm/events{/privacy}","received_events_url":"https://api.github.com/users/realm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/realm/realm-core","description":"Core database component for the Realm Mobile Database SDKs","fork":false,"url":"https://api.github.com/repos/realm/realm-core","forks_url":"https://api.github.com/repos/realm/realm-core/forks","keys_url":"https://api.github.com/repos/realm/realm-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/realm/realm-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/realm/realm-core/teams","hooks_url":"https://api.github.com/repos/realm/realm-core/hooks","issue_events_url":"https://api.github.com/repos/realm/realm-core/issues/events{/number}","events_url":"https://api.github.com/repos/realm/realm-core/events","assignees_url":"https://api.github.com/repos/realm/realm-core/assignees{/user}","branches_url":"https://api.github.com/repos/realm/realm-core/branches{/branch}","tags_url":"https://api.github.com/repos/realm/realm-core/tags","blobs_url":"https://api.github.com/repos/realm/realm-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/realm/realm-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/realm/realm-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/realm/realm-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/realm/realm-core/statuses/{sha}","languages_url":"https://api.github.com/repos/realm/realm-core/languages","stargazers_url":"https://api.github.com/repos/realm/realm-core/stargazers","contributors_url":"https://api.github.com/repos/realm/realm-core/contributors","subscribers_url":"https://api.github.com/repos/realm/realm-core/subscribers","subscription_url":"https://api.github.com/repos/realm/realm-core/subscription","commits_url":"https://api.github.com/repos/realm/realm-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/realm/realm-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/realm/realm-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/realm/realm-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/realm/realm-core/contents/{+path}","compare_url":"https://api.github.com/repos/realm/realm-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/realm/realm-core/merges","archive_url":"https://api.github.com/repos/realm/realm-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/realm/realm-core/downloads","issues_url":"https://api.github.com/repos/realm/realm-core/issues{/number}","pulls_url":"https://api.github.com/repos/realm/realm-core/pulls{/number}","milestones_url":"https://api.github.com/repos/realm/realm-core/milestones{/number}","notifications_url":"https://api.github.com/repos/realm/realm-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/realm/realm-core/labels{/name}","releases_url":"https://api.github.com/repos/realm/realm-core/releases{/id}","deployments_url":"https://api.github.com/repos/realm/realm-core/deployments","created_at":"2011-06-18T21:18:46Z","updated_at":"2016-10-06T08:14:00Z","pushed_at":"2016-10-06T07:48:33Z","git_url":"git://github.com/realm/realm-core.git","ssh_url":"git@github.com:realm/realm-core.git","clone_url":"https://github.com/realm/realm-core.git","svn_url":"https://github.com/realm/realm-core","homepage":"https://realm.io","size":51453,"stargazers_count":396,"watchers_count":396,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":168,"forks":14,"open_issues":168,"watchers":396,"default_branch":"master"}},"base":{"label":"realm:master","ref":"master","sha":"99d32bcdbf1bd97fee49a89ef327c09fbd9019dc","user":{"login":"realm","id":7575099,"avatar_url":"https://avatars.githubusercontent.com/u/7575099?v=3","gravatar_id":"","url":"https://api.github.com/users/realm","html_url":"https://github.com/realm","followers_url":"https://api.github.com/users/realm/followers","following_url":"https://api.github.com/users/realm/following{/other_user}","gists_url":"https://api.github.com/users/realm/gists{/gist_id}","starred_url":"https://api.github.com/users/realm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/realm/subscriptions","organizations_url":"https://api.github.com/users/realm/orgs","repos_url":"https://api.github.com/users/realm/repos","events_url":"https://api.github.com/users/realm/events{/privacy}","received_events_url":"https://api.github.com/users/realm/received_events","type":"Organization","site_admin":false},"repo":{"id":1917262,"name":"realm-core","full_name":"realm/realm-core","owner":{"login":"realm","id":7575099,"avatar_url":"https://avatars.githubusercontent.com/u/7575099?v=3","gravatar_id":"","url":"https://api.github.com/users/realm","html_url":"https://github.com/realm","followers_url":"https://api.github.com/users/realm/followers","following_url":"https://api.github.com/users/realm/following{/other_user}","gists_url":"https://api.github.com/users/realm/gists{/gist_id}","starred_url":"https://api.github.com/users/realm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/realm/subscriptions","organizations_url":"https://api.github.com/users/realm/orgs","repos_url":"https://api.github.com/users/realm/repos","events_url":"https://api.github.com/users/realm/events{/privacy}","received_events_url":"https://api.github.com/users/realm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/realm/realm-core","description":"Core database component for the Realm Mobile Database SDKs","fork":false,"url":"https://api.github.com/repos/realm/realm-core","forks_url":"https://api.github.com/repos/realm/realm-core/forks","keys_url":"https://api.github.com/repos/realm/realm-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/realm/realm-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/realm/realm-core/teams","hooks_url":"https://api.github.com/repos/realm/realm-core/hooks","issue_events_url":"https://api.github.com/repos/realm/realm-core/issues/events{/number}","events_url":"https://api.github.com/repos/realm/realm-core/events","assignees_url":"https://api.github.com/repos/realm/realm-core/assignees{/user}","branches_url":"https://api.github.com/repos/realm/realm-core/branches{/branch}","tags_url":"https://api.github.com/repos/realm/realm-core/tags","blobs_url":"https://api.github.com/repos/realm/realm-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/realm/realm-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/realm/realm-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/realm/realm-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/realm/realm-core/statuses/{sha}","languages_url":"https://api.github.com/repos/realm/realm-core/languages","stargazers_url":"https://api.github.com/repos/realm/realm-core/stargazers","contributors_url":"https://api.github.com/repos/realm/realm-core/contributors","subscribers_url":"https://api.github.com/repos/realm/realm-core/subscribers","subscription_url":"https://api.github.com/repos/realm/realm-core/subscription","commits_url":"https://api.github.com/repos/realm/realm-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/realm/realm-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/realm/realm-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/realm/realm-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/realm/realm-core/contents/{+path}","compare_url":"https://api.github.com/repos/realm/realm-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/realm/realm-core/merges","archive_url":"https://api.github.com/repos/realm/realm-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/realm/realm-core/downloads","issues_url":"https://api.github.com/repos/realm/realm-core/issues{/number}","pulls_url":"https://api.github.com/repos/realm/realm-core/pulls{/number}","milestones_url":"https://api.github.com/repos/realm/realm-core/milestones{/number}","notifications_url":"https://api.github.com/repos/realm/realm-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/realm/realm-core/labels{/name}","releases_url":"https://api.github.com/repos/realm/realm-core/releases{/id}","deployments_url":"https://api.github.com/repos/realm/realm-core/deployments","created_at":"2011-06-18T21:18:46Z","updated_at":"2016-10-06T08:14:00Z","pushed_at":"2016-10-06T07:48:33Z","git_url":"git://github.com/realm/realm-core.git","ssh_url":"git@github.com:realm/realm-core.git","clone_url":"https://github.com/realm/realm-core.git","svn_url":"https://github.com/realm/realm-core","homepage":"https://realm.io","size":51453,"stargazers_count":396,"watchers_count":396,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":168,"forks":14,"open_issues":168,"watchers":396,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/realm/realm-core/pulls/2240"},"html":{"href":"https://github.com/realm/realm-core/pull/2240"},"issue":{"href":"https://api.github.com/repos/realm/realm-core/issues/2240"},"comments":{"href":"https://api.github.com/repos/realm/realm-core/issues/2240/comments"},"review_comments":{"href":"https://api.github.com/repos/realm/realm-core/pulls/2240/comments"},"review_comment":{"href":"https://api.github.com/repos/realm/realm-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/realm/realm-core/pulls/2240/commits"},"statuses":{"href":"https://api.github.com/repos/realm/realm-core/statuses/3be4e871f0815c69d6698a9a9a7a8caa2ac984c9"}}}}
{"actor":{"display_login":"bmunkholm"}}