{"action":"created","comment":{"url":"https://api.github.com/repos/ripple/rippled/pulls/comments/78625167","id":78625167,"diff_hunk":"@@ -34,14 +34,49 @@ namespace ripple {\n class Buffer\n {\n private:\n-    std::unique_ptr<\n-        std::uint8_t[]> p_;\n+    std::unique_ptr<std::uint8_t[]> p_;\n     std::size_t size_ = 0;\n \n public:\n     Buffer() = default;\n-    Buffer (Buffer const&) = delete;\n-    Buffer& operator= (Buffer const&) = delete;\n+\n+    /** Create an uninitialized buffer with the given size. */\n+    explicit\n+    Buffer (std::size_t size)\n+        : p_ (size ? new std::uint8_t[size] : nullptr)\n+        , size_ (size)\n+    {\n+    }\n+\n+    /** Create a buffer as a copy of existing memory.\n+\n+        @param data a pointer to the existing memory. If\n+                    size is non-zero, it must not be null.\n+        @param size size of the existing memory block.\n+    */\n+    Buffer (void const* data, std::size_t size)\n+        : Buffer (size)\n+    {\n+        if (size)\n+            std::memcpy(p_.get(), data, size);","path":"src/ripple/basics/Buffer.h","position":32,"original_position":32,"commit_id":"25097bf0da016a60c07467a77d2326562612ac16","original_commit_id":"25097bf0da016a60c07467a77d2326562612ac16","user":{"login":"ximinez","id":6757714,"avatar_url":"https://avatars.githubusercontent.com/u/6757714?v=3","gravatar_id":"","url":"https://api.github.com/users/ximinez","html_url":"https://github.com/ximinez","followers_url":"https://api.github.com/users/ximinez/followers","following_url":"https://api.github.com/users/ximinez/following{/other_user}","gists_url":"https://api.github.com/users/ximinez/gists{/gist_id}","starred_url":"https://api.github.com/users/ximinez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ximinez/subscriptions","organizations_url":"https://api.github.com/users/ximinez/orgs","repos_url":"https://api.github.com/users/ximinez/repos","events_url":"https://api.github.com/users/ximinez/events{/privacy}","received_events_url":"https://api.github.com/users/ximinez/received_events","type":"User","site_admin":false},"body":"Nit: `memcpy` does the right thing if `size == 0`, doesn't it, so is it worth it to skip the check?","created_at":"2016-09-13T19:14:01Z","updated_at":"2016-09-13T19:14:01Z","html_url":"https://github.com/ripple/rippled/pull/1841#discussion_r78625167","pull_request_url":"https://api.github.com/repos/ripple/rippled/pulls/1841","_links":{"self":{"href":"https://api.github.com/repos/ripple/rippled/pulls/comments/78625167"},"html":{"href":"https://github.com/ripple/rippled/pull/1841#discussion_r78625167"},"pull_request":{"href":"https://api.github.com/repos/ripple/rippled/pulls/1841"}}},"pull_request":{"url":"https://api.github.com/repos/ripple/rippled/pulls/1841","id":84898727,"html_url":"https://github.com/ripple/rippled/pull/1841","diff_url":"https://github.com/ripple/rippled/pull/1841.diff","patch_url":"https://github.com/ripple/rippled/pull/1841.patch","issue_url":"https://api.github.com/repos/ripple/rippled/issues/1841","number":1841,"state":"open","locked":false,"title":"Improve Buffer and Slice:","user":{"login":"nbougalis","id":5085415,"avatar_url":"https://avatars.githubusercontent.com/u/5085415?v=3","gravatar_id":"","url":"https://api.github.com/users/nbougalis","html_url":"https://github.com/nbougalis","followers_url":"https://api.github.com/users/nbougalis/followers","following_url":"https://api.github.com/users/nbougalis/following{/other_user}","gists_url":"https://api.github.com/users/nbougalis/gists{/gist_id}","starred_url":"https://api.github.com/users/nbougalis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nbougalis/subscriptions","organizations_url":"https://api.github.com/users/nbougalis/orgs","repos_url":"https://api.github.com/users/nbougalis/repos","events_url":"https://api.github.com/users/nbougalis/events{/privacy}","received_events_url":"https://api.github.com/users/nbougalis/received_events","type":"User","site_admin":false},"body":"* Make Buffer constructible from a Slice\r\n* Fix self-move-assignment in Buffer\r\n* Add [c]begin/[c]end","created_at":"2016-09-12T16:05:27Z","updated_at":"2016-09-13T19:14:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0cba87fe406f17bc0a1976689c5f03c7ffd21529","assignee":{"login":"ximinez","id":6757714,"avatar_url":"https://avatars.githubusercontent.com/u/6757714?v=3","gravatar_id":"","url":"https://api.github.com/users/ximinez","html_url":"https://github.com/ximinez","followers_url":"https://api.github.com/users/ximinez/followers","following_url":"https://api.github.com/users/ximinez/following{/other_user}","gists_url":"https://api.github.com/users/ximinez/gists{/gist_id}","starred_url":"https://api.github.com/users/ximinez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ximinez/subscriptions","organizations_url":"https://api.github.com/users/ximinez/orgs","repos_url":"https://api.github.com/users/ximinez/repos","events_url":"https://api.github.com/users/ximinez/events{/privacy}","received_events_url":"https://api.github.com/users/ximinez/received_events","type":"User","site_admin":false},"assignees":[{"login":"ximinez","id":6757714,"avatar_url":"https://avatars.githubusercontent.com/u/6757714?v=3","gravatar_id":"","url":"https://api.github.com/users/ximinez","html_url":"https://github.com/ximinez","followers_url":"https://api.github.com/users/ximinez/followers","following_url":"https://api.github.com/users/ximinez/following{/other_user}","gists_url":"https://api.github.com/users/ximinez/gists{/gist_id}","starred_url":"https://api.github.com/users/ximinez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ximinez/subscriptions","organizations_url":"https://api.github.com/users/ximinez/orgs","repos_url":"https://api.github.com/users/ximinez/repos","events_url":"https://api.github.com/users/ximinez/events{/privacy}","received_events_url":"https://api.github.com/users/ximinez/received_events","type":"User","site_admin":false},{"login":"scottschurr","id":7840379,"avatar_url":"https://avatars.githubusercontent.com/u/7840379?v=3","gravatar_id":"","url":"https://api.github.com/users/scottschurr","html_url":"https://github.com/scottschurr","followers_url":"https://api.github.com/users/scottschurr/followers","following_url":"https://api.github.com/users/scottschurr/following{/other_user}","gists_url":"https://api.github.com/users/scottschurr/gists{/gist_id}","starred_url":"https://api.github.com/users/scottschurr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottschurr/subscriptions","organizations_url":"https://api.github.com/users/scottschurr/orgs","repos_url":"https://api.github.com/users/scottschurr/repos","events_url":"https://api.github.com/users/scottschurr/events{/privacy}","received_events_url":"https://api.github.com/users/scottschurr/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ripple/rippled/pulls/1841/commits","review_comments_url":"https://api.github.com/repos/ripple/rippled/pulls/1841/comments","review_comment_url":"https://api.github.com/repos/ripple/rippled/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ripple/rippled/issues/1841/comments","statuses_url":"https://api.github.com/repos/ripple/rippled/statuses/25097bf0da016a60c07467a77d2326562612ac16","head":{"label":"nbougalis:slice","ref":"slice","sha":"25097bf0da016a60c07467a77d2326562612ac16","user":{"login":"nbougalis","id":5085415,"avatar_url":"https://avatars.githubusercontent.com/u/5085415?v=3","gravatar_id":"","url":"https://api.github.com/users/nbougalis","html_url":"https://github.com/nbougalis","followers_url":"https://api.github.com/users/nbougalis/followers","following_url":"https://api.github.com/users/nbougalis/following{/other_user}","gists_url":"https://api.github.com/users/nbougalis/gists{/gist_id}","starred_url":"https://api.github.com/users/nbougalis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nbougalis/subscriptions","organizations_url":"https://api.github.com/users/nbougalis/orgs","repos_url":"https://api.github.com/users/nbougalis/repos","events_url":"https://api.github.com/users/nbougalis/events{/privacy}","received_events_url":"https://api.github.com/users/nbougalis/received_events","type":"User","site_admin":false},"repo":{"id":12092814,"name":"rippled","full_name":"nbougalis/rippled","owner":{"login":"nbougalis","id":5085415,"avatar_url":"https://avatars.githubusercontent.com/u/5085415?v=3","gravatar_id":"","url":"https://api.github.com/users/nbougalis","html_url":"https://github.com/nbougalis","followers_url":"https://api.github.com/users/nbougalis/followers","following_url":"https://api.github.com/users/nbougalis/following{/other_user}","gists_url":"https://api.github.com/users/nbougalis/gists{/gist_id}","starred_url":"https://api.github.com/users/nbougalis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nbougalis/subscriptions","organizations_url":"https://api.github.com/users/nbougalis/orgs","repos_url":"https://api.github.com/users/nbougalis/repos","events_url":"https://api.github.com/users/nbougalis/events{/privacy}","received_events_url":"https://api.github.com/users/nbougalis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nbougalis/rippled","description":"Ripple peer-to-peer network daemon","fork":true,"url":"https://api.github.com/repos/nbougalis/rippled","forks_url":"https://api.github.com/repos/nbougalis/rippled/forks","keys_url":"https://api.github.com/repos/nbougalis/rippled/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nbougalis/rippled/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nbougalis/rippled/teams","hooks_url":"https://api.github.com/repos/nbougalis/rippled/hooks","issue_events_url":"https://api.github.com/repos/nbougalis/rippled/issues/events{/number}","events_url":"https://api.github.com/repos/nbougalis/rippled/events","assignees_url":"https://api.github.com/repos/nbougalis/rippled/assignees{/user}","branches_url":"https://api.github.com/repos/nbougalis/rippled/branches{/branch}","tags_url":"https://api.github.com/repos/nbougalis/rippled/tags","blobs_url":"https://api.github.com/repos/nbougalis/rippled/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nbougalis/rippled/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nbougalis/rippled/git/refs{/sha}","trees_url":"https://api.github.com/repos/nbougalis/rippled/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nbougalis/rippled/statuses/{sha}","languages_url":"https://api.github.com/repos/nbougalis/rippled/languages","stargazers_url":"https://api.github.com/repos/nbougalis/rippled/stargazers","contributors_url":"https://api.github.com/repos/nbougalis/rippled/contributors","subscribers_url":"https://api.github.com/repos/nbougalis/rippled/subscribers","subscription_url":"https://api.github.com/repos/nbougalis/rippled/subscription","commits_url":"https://api.github.com/repos/nbougalis/rippled/commits{/sha}","git_commits_url":"https://api.github.com/repos/nbougalis/rippled/git/commits{/sha}","comments_url":"https://api.github.com/repos/nbougalis/rippled/comments{/number}","issue_comment_url":"https://api.github.com/repos/nbougalis/rippled/issues/comments{/number}","contents_url":"https://api.github.com/repos/nbougalis/rippled/contents/{+path}","compare_url":"https://api.github.com/repos/nbougalis/rippled/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nbougalis/rippled/merges","archive_url":"https://api.github.com/repos/nbougalis/rippled/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nbougalis/rippled/downloads","issues_url":"https://api.github.com/repos/nbougalis/rippled/issues{/number}","pulls_url":"https://api.github.com/repos/nbougalis/rippled/pulls{/number}","milestones_url":"https://api.github.com/repos/nbougalis/rippled/milestones{/number}","notifications_url":"https://api.github.com/repos/nbougalis/rippled/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nbougalis/rippled/labels{/name}","releases_url":"https://api.github.com/repos/nbougalis/rippled/releases{/id}","deployments_url":"https://api.github.com/repos/nbougalis/rippled/deployments","created_at":"2013-08-13T20:58:04Z","updated_at":"2015-05-06T20:28:38Z","pushed_at":"2016-09-12T16:24:00Z","git_url":"git://github.com/nbougalis/rippled.git","ssh_url":"git@github.com:nbougalis/rippled.git","clone_url":"https://github.com/nbougalis/rippled.git","svn_url":"https://github.com/nbougalis/rippled","homepage":"https://ripple.com","size":60346,"stargazers_count":0,"watchers_count":0,"language":"C++","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":0,"default_branch":"develop-next"}},"base":{"label":"ripple:develop","ref":"develop","sha":"87756b93248e5383f30b587c5590686bda6072a1","user":{"login":"ripple","id":3165523,"avatar_url":"https://avatars.githubusercontent.com/u/3165523?v=3","gravatar_id":"","url":"https://api.github.com/users/ripple","html_url":"https://github.com/ripple","followers_url":"https://api.github.com/users/ripple/followers","following_url":"https://api.github.com/users/ripple/following{/other_user}","gists_url":"https://api.github.com/users/ripple/gists{/gist_id}","starred_url":"https://api.github.com/users/ripple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ripple/subscriptions","organizations_url":"https://api.github.com/users/ripple/orgs","repos_url":"https://api.github.com/users/ripple/repos","events_url":"https://api.github.com/users/ripple/events{/privacy}","received_events_url":"https://api.github.com/users/ripple/received_events","type":"Organization","site_admin":false},"repo":{"id":2724167,"name":"rippled","full_name":"ripple/rippled","owner":{"login":"ripple","id":3165523,"avatar_url":"https://avatars.githubusercontent.com/u/3165523?v=3","gravatar_id":"","url":"https://api.github.com/users/ripple","html_url":"https://github.com/ripple","followers_url":"https://api.github.com/users/ripple/followers","following_url":"https://api.github.com/users/ripple/following{/other_user}","gists_url":"https://api.github.com/users/ripple/gists{/gist_id}","starred_url":"https://api.github.com/users/ripple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ripple/subscriptions","organizations_url":"https://api.github.com/users/ripple/orgs","repos_url":"https://api.github.com/users/ripple/repos","events_url":"https://api.github.com/users/ripple/events{/privacy}","received_events_url":"https://api.github.com/users/ripple/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ripple/rippled","description":"Decentralized cryptocurrency blockchain daemon implementing the Ripple Consensus Ledger in C++","fork":false,"url":"https://api.github.com/repos/ripple/rippled","forks_url":"https://api.github.com/repos/ripple/rippled/forks","keys_url":"https://api.github.com/repos/ripple/rippled/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ripple/rippled/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ripple/rippled/teams","hooks_url":"https://api.github.com/repos/ripple/rippled/hooks","issue_events_url":"https://api.github.com/repos/ripple/rippled/issues/events{/number}","events_url":"https://api.github.com/repos/ripple/rippled/events","assignees_url":"https://api.github.com/repos/ripple/rippled/assignees{/user}","branches_url":"https://api.github.com/repos/ripple/rippled/branches{/branch}","tags_url":"https://api.github.com/repos/ripple/rippled/tags","blobs_url":"https://api.github.com/repos/ripple/rippled/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ripple/rippled/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ripple/rippled/git/refs{/sha}","trees_url":"https://api.github.com/repos/ripple/rippled/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ripple/rippled/statuses/{sha}","languages_url":"https://api.github.com/repos/ripple/rippled/languages","stargazers_url":"https://api.github.com/repos/ripple/rippled/stargazers","contributors_url":"https://api.github.com/repos/ripple/rippled/contributors","subscribers_url":"https://api.github.com/repos/ripple/rippled/subscribers","subscription_url":"https://api.github.com/repos/ripple/rippled/subscription","commits_url":"https://api.github.com/repos/ripple/rippled/commits{/sha}","git_commits_url":"https://api.github.com/repos/ripple/rippled/git/commits{/sha}","comments_url":"https://api.github.com/repos/ripple/rippled/comments{/number}","issue_comment_url":"https://api.github.com/repos/ripple/rippled/issues/comments{/number}","contents_url":"https://api.github.com/repos/ripple/rippled/contents/{+path}","compare_url":"https://api.github.com/repos/ripple/rippled/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ripple/rippled/merges","archive_url":"https://api.github.com/repos/ripple/rippled/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ripple/rippled/downloads","issues_url":"https://api.github.com/repos/ripple/rippled/issues{/number}","pulls_url":"https://api.github.com/repos/ripple/rippled/pulls{/number}","milestones_url":"https://api.github.com/repos/ripple/rippled/milestones{/number}","notifications_url":"https://api.github.com/repos/ripple/rippled/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ripple/rippled/labels{/name}","releases_url":"https://api.github.com/repos/ripple/rippled/releases{/id}","deployments_url":"https://api.github.com/repos/ripple/rippled/deployments","created_at":"2011-11-07T04:40:15Z","updated_at":"2016-09-13T09:00:01Z","pushed_at":"2016-09-13T17:55:23Z","git_url":"git://github.com/ripple/rippled.git","ssh_url":"git@github.com:ripple/rippled.git","clone_url":"https://github.com/ripple/rippled.git","svn_url":"https://github.com/ripple/rippled","homepage":"https://ripple.com","size":113828,"stargazers_count":1133,"watchers_count":1133,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":345,"mirror_url":null,"open_issues_count":117,"forks":345,"open_issues":117,"watchers":1133,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ripple/rippled/pulls/1841"},"html":{"href":"https://github.com/ripple/rippled/pull/1841"},"issue":{"href":"https://api.github.com/repos/ripple/rippled/issues/1841"},"comments":{"href":"https://api.github.com/repos/ripple/rippled/issues/1841/comments"},"review_comments":{"href":"https://api.github.com/repos/ripple/rippled/pulls/1841/comments"},"review_comment":{"href":"https://api.github.com/repos/ripple/rippled/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ripple/rippled/pulls/1841/commits"},"statuses":{"href":"https://api.github.com/repos/ripple/rippled/statuses/25097bf0da016a60c07467a77d2326562612ac16"}}}}
{"actor":{"display_login":"ximinez"}}