{"action":"created","comment":{"url":"https://api.github.com/repos/D-Programming-Language/druntime/pulls/comments/40414002","id":40414002,"diff_hunk":"@@ -517,3 +519,20 @@ unittest\n     assert(mulu(0UL, 0UL, overflow) == 0);\n     assert(overflow);                   // sticky\n }\n+\n+\n+private:\n+\n+pragma(inline, true)\n+@property size_t _signBit(T)(in T n)\n+if(is(T == int) || is(T == long))\n+{\n+    return cast(size_t) (n >>> T.sizeof * 8 - 1);","path":"src/core/checkedint.d","position":153,"original_position":153,"commit_id":"83ec881826e15f98ad8455e43ff20914424ae2f4","original_commit_id":"83ec881826e15f98ad8455e43ff20914424ae2f4","user":{"login":"WalterBright","id":568298,"avatar_url":"https://avatars.githubusercontent.com/u/568298?v=3","gravatar_id":"","url":"https://api.github.com/users/WalterBright","html_url":"https://github.com/WalterBright","followers_url":"https://api.github.com/users/WalterBright/followers","following_url":"https://api.github.com/users/WalterBright/following{/other_user}","gists_url":"https://api.github.com/users/WalterBright/gists{/gist_id}","starred_url":"https://api.github.com/users/WalterBright/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WalterBright/subscriptions","organizations_url":"https://api.github.com/users/WalterBright/orgs","repos_url":"https://api.github.com/users/WalterBright/repos","events_url":"https://api.github.com/users/WalterBright/events{/privacy}","received_events_url":"https://api.github.com/users/WalterBright/received_events","type":"User","site_admin":false},"body":"Many compilers generate very good code for `bool b = a < b;`. I suggest that instead of the shift. And besides, this function is a bit peculiar in returning all 0's or all 1's.","created_at":"2015-09-25T09:37:31Z","updated_at":"2015-09-25T09:37:31Z","html_url":"https://github.com/D-Programming-Language/druntime/pull/1394#discussion_r40414002","pull_request_url":"https://api.github.com/repos/D-Programming-Language/druntime/pulls/1394","_links":{"self":{"href":"https://api.github.com/repos/D-Programming-Language/druntime/pulls/comments/40414002"},"html":{"href":"https://github.com/D-Programming-Language/druntime/pull/1394#discussion_r40414002"},"pull_request":{"href":"https://api.github.com/repos/D-Programming-Language/druntime/pulls/1394"}}},"pull_request":{"url":"https://api.github.com/repos/D-Programming-Language/druntime/pulls/1394","id":45686129,"html_url":"https://github.com/D-Programming-Language/druntime/pull/1394","diff_url":"https://github.com/D-Programming-Language/druntime/pull/1394.diff","patch_url":"https://github.com/D-Programming-Language/druntime/pull/1394.patch","issue_url":"https://api.github.com/repos/D-Programming-Language/druntime/issues/1394","number":1394,"state":"open","locked":false,"title":"Rewrite `core.checkedint` functions.","user":{"login":"denis-sh","id":751661,"avatar_url":"https://avatars.githubusercontent.com/u/751661?v=3","gravatar_id":"","url":"https://api.github.com/users/denis-sh","html_url":"https://github.com/denis-sh","followers_url":"https://api.github.com/users/denis-sh/followers","following_url":"https://api.github.com/users/denis-sh/following{/other_user}","gists_url":"https://api.github.com/users/denis-sh/gists{/gist_id}","starred_url":"https://api.github.com/users/denis-sh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/denis-sh/subscriptions","organizations_url":"https://api.github.com/users/denis-sh/orgs","repos_url":"https://api.github.com/users/denis-sh/repos","events_url":"https://api.github.com/users/denis-sh/events{/privacy}","received_events_url":"https://api.github.com/users/denis-sh/received_events","type":"User","site_admin":false},"body":"Use fast and simple sign comparison instead of long, slow and complicated value comparisons.\r\n\r\nAlso remove reference as it doesn't apply anymore.\r\n\r\n#### P.S.\r\nI planned to rewrite this module implementation since its creation because it's clearly written in a hurry (e.g. see `r < x || r < y` check in `addu`), sorry this took that long to get to it. IMHO this is one of the modules that have to show source code readers how simple, robust and efficient code should be written in *D*.","created_at":"2015-09-22T16:31:39Z","updated_at":"2015-09-25T09:37:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"36c2998e4604153d47c1780e81b17ca4e0a42ea6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/D-Programming-Language/druntime/pulls/1394/commits","review_comments_url":"https://api.github.com/repos/D-Programming-Language/druntime/pulls/1394/comments","review_comment_url":"https://api.github.com/repos/D-Programming-Language/druntime/pulls/comments{/number}","comments_url":"https://api.github.com/repos/D-Programming-Language/druntime/issues/1394/comments","statuses_url":"https://api.github.com/repos/D-Programming-Language/druntime/statuses/83ec881826e15f98ad8455e43ff20914424ae2f4","head":{"label":"denis-sh:imprve-`core.checkedint`","ref":"imprve-`core.checkedint`","sha":"83ec881826e15f98ad8455e43ff20914424ae2f4","user":{"login":"denis-sh","id":751661,"avatar_url":"https://avatars.githubusercontent.com/u/751661?v=3","gravatar_id":"","url":"https://api.github.com/users/denis-sh","html_url":"https://github.com/denis-sh","followers_url":"https://api.github.com/users/denis-sh/followers","following_url":"https://api.github.com/users/denis-sh/following{/other_user}","gists_url":"https://api.github.com/users/denis-sh/gists{/gist_id}","starred_url":"https://api.github.com/users/denis-sh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/denis-sh/subscriptions","organizations_url":"https://api.github.com/users/denis-sh/orgs","repos_url":"https://api.github.com/users/denis-sh/repos","events_url":"https://api.github.com/users/denis-sh/events{/privacy}","received_events_url":"https://api.github.com/users/denis-sh/received_events","type":"User","site_admin":false},"repo":{"id":3258421,"name":"druntime","full_name":"denis-sh/druntime","owner":{"login":"denis-sh","id":751661,"avatar_url":"https://avatars.githubusercontent.com/u/751661?v=3","gravatar_id":"","url":"https://api.github.com/users/denis-sh","html_url":"https://github.com/denis-sh","followers_url":"https://api.github.com/users/denis-sh/followers","following_url":"https://api.github.com/users/denis-sh/following{/other_user}","gists_url":"https://api.github.com/users/denis-sh/gists{/gist_id}","starred_url":"https://api.github.com/users/denis-sh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/denis-sh/subscriptions","organizations_url":"https://api.github.com/users/denis-sh/orgs","repos_url":"https://api.github.com/users/denis-sh/repos","events_url":"https://api.github.com/users/denis-sh/events{/privacy}","received_events_url":"https://api.github.com/users/denis-sh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/denis-sh/druntime","description":"Low level runtime library for the D programming language","fork":true,"url":"https://api.github.com/repos/denis-sh/druntime","forks_url":"https://api.github.com/repos/denis-sh/druntime/forks","keys_url":"https://api.github.com/repos/denis-sh/druntime/keys{/key_id}","collaborators_url":"https://api.github.com/repos/denis-sh/druntime/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/denis-sh/druntime/teams","hooks_url":"https://api.github.com/repos/denis-sh/druntime/hooks","issue_events_url":"https://api.github.com/repos/denis-sh/druntime/issues/events{/number}","events_url":"https://api.github.com/repos/denis-sh/druntime/events","assignees_url":"https://api.github.com/repos/denis-sh/druntime/assignees{/user}","branches_url":"https://api.github.com/repos/denis-sh/druntime/branches{/branch}","tags_url":"https://api.github.com/repos/denis-sh/druntime/tags","blobs_url":"https://api.github.com/repos/denis-sh/druntime/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/denis-sh/druntime/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/denis-sh/druntime/git/refs{/sha}","trees_url":"https://api.github.com/repos/denis-sh/druntime/git/trees{/sha}","statuses_url":"https://api.github.com/repos/denis-sh/druntime/statuses/{sha}","languages_url":"https://api.github.com/repos/denis-sh/druntime/languages","stargazers_url":"https://api.github.com/repos/denis-sh/druntime/stargazers","contributors_url":"https://api.github.com/repos/denis-sh/druntime/contributors","subscribers_url":"https://api.github.com/repos/denis-sh/druntime/subscribers","subscription_url":"https://api.github.com/repos/denis-sh/druntime/subscription","commits_url":"https://api.github.com/repos/denis-sh/druntime/commits{/sha}","git_commits_url":"https://api.github.com/repos/denis-sh/druntime/git/commits{/sha}","comments_url":"https://api.github.com/repos/denis-sh/druntime/comments{/number}","issue_comment_url":"https://api.github.com/repos/denis-sh/druntime/issues/comments{/number}","contents_url":"https://api.github.com/repos/denis-sh/druntime/contents/{+path}","compare_url":"https://api.github.com/repos/denis-sh/druntime/compare/{base}...{head}","merges_url":"https://api.github.com/repos/denis-sh/druntime/merges","archive_url":"https://api.github.com/repos/denis-sh/druntime/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/denis-sh/druntime/downloads","issues_url":"https://api.github.com/repos/denis-sh/druntime/issues{/number}","pulls_url":"https://api.github.com/repos/denis-sh/druntime/pulls{/number}","milestones_url":"https://api.github.com/repos/denis-sh/druntime/milestones{/number}","notifications_url":"https://api.github.com/repos/denis-sh/druntime/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/denis-sh/druntime/labels{/name}","releases_url":"https://api.github.com/repos/denis-sh/druntime/releases{/id}","created_at":"2012-01-24T18:31:06Z","updated_at":"2014-06-19T11:50:16Z","pushed_at":"2015-09-25T08:33:12Z","git_url":"git://github.com/denis-sh/druntime.git","ssh_url":"git@github.com:denis-sh/druntime.git","clone_url":"https://github.com/denis-sh/druntime.git","svn_url":"https://github.com/denis-sh/druntime","homepage":"d-programming-language.org","size":9962,"stargazers_count":1,"watchers_count":1,"language":"D","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"D-Programming-Language:master","ref":"master","sha":"f0f8edaeb56294460aedbae3d91c7d3b304516b6","user":{"login":"D-Programming-Language","id":565913,"avatar_url":"https://avatars.githubusercontent.com/u/565913?v=3","gravatar_id":"","url":"https://api.github.com/users/D-Programming-Language","html_url":"https://github.com/D-Programming-Language","followers_url":"https://api.github.com/users/D-Programming-Language/followers","following_url":"https://api.github.com/users/D-Programming-Language/following{/other_user}","gists_url":"https://api.github.com/users/D-Programming-Language/gists{/gist_id}","starred_url":"https://api.github.com/users/D-Programming-Language/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/D-Programming-Language/subscriptions","organizations_url":"https://api.github.com/users/D-Programming-Language/orgs","repos_url":"https://api.github.com/users/D-Programming-Language/repos","events_url":"https://api.github.com/users/D-Programming-Language/events{/privacy}","received_events_url":"https://api.github.com/users/D-Programming-Language/received_events","type":"Organization","site_admin":false},"repo":{"id":1257087,"name":"druntime","full_name":"D-Programming-Language/druntime","owner":{"login":"D-Programming-Language","id":565913,"avatar_url":"https://avatars.githubusercontent.com/u/565913?v=3","gravatar_id":"","url":"https://api.github.com/users/D-Programming-Language","html_url":"https://github.com/D-Programming-Language","followers_url":"https://api.github.com/users/D-Programming-Language/followers","following_url":"https://api.github.com/users/D-Programming-Language/following{/other_user}","gists_url":"https://api.github.com/users/D-Programming-Language/gists{/gist_id}","starred_url":"https://api.github.com/users/D-Programming-Language/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/D-Programming-Language/subscriptions","organizations_url":"https://api.github.com/users/D-Programming-Language/orgs","repos_url":"https://api.github.com/users/D-Programming-Language/repos","events_url":"https://api.github.com/users/D-Programming-Language/events{/privacy}","received_events_url":"https://api.github.com/users/D-Programming-Language/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/D-Programming-Language/druntime","description":"Low level runtime library for the D programming language","fork":false,"url":"https://api.github.com/repos/D-Programming-Language/druntime","forks_url":"https://api.github.com/repos/D-Programming-Language/druntime/forks","keys_url":"https://api.github.com/repos/D-Programming-Language/druntime/keys{/key_id}","collaborators_url":"https://api.github.com/repos/D-Programming-Language/druntime/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/D-Programming-Language/druntime/teams","hooks_url":"https://api.github.com/repos/D-Programming-Language/druntime/hooks","issue_events_url":"https://api.github.com/repos/D-Programming-Language/druntime/issues/events{/number}","events_url":"https://api.github.com/repos/D-Programming-Language/druntime/events","assignees_url":"https://api.github.com/repos/D-Programming-Language/druntime/assignees{/user}","branches_url":"https://api.github.com/repos/D-Programming-Language/druntime/branches{/branch}","tags_url":"https://api.github.com/repos/D-Programming-Language/druntime/tags","blobs_url":"https://api.github.com/repos/D-Programming-Language/druntime/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/D-Programming-Language/druntime/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/D-Programming-Language/druntime/git/refs{/sha}","trees_url":"https://api.github.com/repos/D-Programming-Language/druntime/git/trees{/sha}","statuses_url":"https://api.github.com/repos/D-Programming-Language/druntime/statuses/{sha}","languages_url":"https://api.github.com/repos/D-Programming-Language/druntime/languages","stargazers_url":"https://api.github.com/repos/D-Programming-Language/druntime/stargazers","contributors_url":"https://api.github.com/repos/D-Programming-Language/druntime/contributors","subscribers_url":"https://api.github.com/repos/D-Programming-Language/druntime/subscribers","subscription_url":"https://api.github.com/repos/D-Programming-Language/druntime/subscription","commits_url":"https://api.github.com/repos/D-Programming-Language/druntime/commits{/sha}","git_commits_url":"https://api.github.com/repos/D-Programming-Language/druntime/git/commits{/sha}","comments_url":"https://api.github.com/repos/D-Programming-Language/druntime/comments{/number}","issue_comment_url":"https://api.github.com/repos/D-Programming-Language/druntime/issues/comments{/number}","contents_url":"https://api.github.com/repos/D-Programming-Language/druntime/contents/{+path}","compare_url":"https://api.github.com/repos/D-Programming-Language/druntime/compare/{base}...{head}","merges_url":"https://api.github.com/repos/D-Programming-Language/druntime/merges","archive_url":"https://api.github.com/repos/D-Programming-Language/druntime/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/D-Programming-Language/druntime/downloads","issues_url":"https://api.github.com/repos/D-Programming-Language/druntime/issues{/number}","pulls_url":"https://api.github.com/repos/D-Programming-Language/druntime/pulls{/number}","milestones_url":"https://api.github.com/repos/D-Programming-Language/druntime/milestones{/number}","notifications_url":"https://api.github.com/repos/D-Programming-Language/druntime/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/D-Programming-Language/druntime/labels{/name}","releases_url":"https://api.github.com/repos/D-Programming-Language/druntime/releases{/id}","created_at":"2011-01-15T07:01:38Z","updated_at":"2015-09-21T12:14:57Z","pushed_at":"2015-09-25T08:33:13Z","git_url":"git://github.com/D-Programming-Language/druntime.git","ssh_url":"git@github.com:D-Programming-Language/druntime.git","clone_url":"https://github.com/D-Programming-Language/druntime.git","svn_url":"https://github.com/D-Programming-Language/druntime","homepage":"dlang.org","size":20523,"stargazers_count":372,"watchers_count":372,"language":"D","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":253,"mirror_url":null,"open_issues_count":29,"forks":253,"open_issues":29,"watchers":372,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/D-Programming-Language/druntime/pulls/1394"},"html":{"href":"https://github.com/D-Programming-Language/druntime/pull/1394"},"issue":{"href":"https://api.github.com/repos/D-Programming-Language/druntime/issues/1394"},"comments":{"href":"https://api.github.com/repos/D-Programming-Language/druntime/issues/1394/comments"},"review_comments":{"href":"https://api.github.com/repos/D-Programming-Language/druntime/pulls/1394/comments"},"review_comment":{"href":"https://api.github.com/repos/D-Programming-Language/druntime/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/D-Programming-Language/druntime/pulls/1394/commits"},"statuses":{"href":"https://api.github.com/repos/D-Programming-Language/druntime/statuses/83ec881826e15f98ad8455e43ff20914424ae2f4"}}}}