{"action":"created","comment":{"url":"https://api.github.com/repos/Ward9250/Roaring.jl/pulls/comments/90871465","pull_request_review_id":11384901,"id":90871465,"diff_hunk":"@@ -0,0 +1,45 @@\n+\n+\n+\"\"\"\n+Add `value` to an ArrayContainer. Returns true if `value` was not already\n+present.\n+\"\"\"\n+@inline function add!{T<:Unsigned}(container::ArrayContainer, value::T)\n+    insertpoint = searchsorted(container.arr, value)\n+    # splice! won't do anything if the array already has the value (insertpoint)\n+    # has a length of 1.\n+    splice!(container.arr, insertpoint, value)\n+    return isempty(insertpoint)\n+end\n+\n+\"\"\"\n+Add a number of values to an `ArrayContainer`.\n+\"\"\"\n+@inline function add!{T<:AbstractArray{UInt16,1}}(container::ArrayContainer, values::T)\n+    for value in range\n+        add!(container, value)\n+    end\n+end\n+\n+\"\"\"\n+    append!(arr::ArrayContainer, pos::UInt16)\n+\n+Append `value` to the `ArrayContainer` `arr`, this assumes that the value being\n+appended is larger than any value currently in the container.\n+\"\"\"\n+@inline function append!{T<:Unsigned}(container::ArrayContainer, value::T)\n+    push!(container.arr, value)\n+end\n+\n+\"Remove `value` from an ArrayContainer. Returns true if `value` was present.\"\n+@inline function remove!{T<:Unsigned}(container::ArrayContainer, value::T)\n+    rempoint = searchsorted(container.arr, value)\n+    # deleteat! won't do anything if rempoint is empty.","path":"src/array_container/manipulation.jl","position":null,"original_position":37,"commit_id":"70d6b32e0fefd6f22582188be88cd13a3f6568ee","original_commit_id":"825f003fb35b47f2f7eb59c2aaa3fbdb0b2011a8","user":{"login":"Ward9250","id":3399309,"avatar_url":"https://avatars.githubusercontent.com/u/3399309?v=3","gravatar_id":"","url":"https://api.github.com/users/Ward9250","html_url":"https://github.com/Ward9250","followers_url":"https://api.github.com/users/Ward9250/followers","following_url":"https://api.github.com/users/Ward9250/following{/other_user}","gists_url":"https://api.github.com/users/Ward9250/gists{/gist_id}","starred_url":"https://api.github.com/users/Ward9250/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ward9250/subscriptions","organizations_url":"https://api.github.com/users/Ward9250/orgs","repos_url":"https://api.github.com/users/Ward9250/repos","events_url":"https://api.github.com/users/Ward9250/events{/privacy}","received_events_url":"https://api.github.com/users/Ward9250/received_events","type":"User","site_admin":false},"body":"I've edited add! and remove! to use the ternary operator as you suggest. If you have ideas of how this could be speed up when you have many more values i.e. \r\n\r\n```julia\r\n\"\"\"\r\nAdd a number of values to an `ArrayContainer`.\r\n\"\"\"\r\n@inline function add!{T<:AbstractArray{UInt16,1}}(arr::ArrayContainer, vals::T)\r\n    for val in vals\r\n        add!(arr, val)\r\n    end\r\nend\r\n```\r\n\r\nI'm all ears, as I can imagine it being quite the performance bottleneck when adding many values.","created_at":"2016-12-05T14:17:08Z","updated_at":"2016-12-05T14:17:08Z","html_url":"https://github.com/Ward9250/Roaring.jl/pull/2#discussion_r90871465","pull_request_url":"https://api.github.com/repos/Ward9250/Roaring.jl/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/Ward9250/Roaring.jl/pulls/comments/90871465"},"html":{"href":"https://github.com/Ward9250/Roaring.jl/pull/2#discussion_r90871465"},"pull_request":{"href":"https://api.github.com/repos/Ward9250/Roaring.jl/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/Ward9250/Roaring.jl/pulls/2","id":96303223,"html_url":"https://github.com/Ward9250/Roaring.jl/pull/2","diff_url":"https://github.com/Ward9250/Roaring.jl/pull/2.diff","patch_url":"https://github.com/Ward9250/Roaring.jl/pull/2.patch","issue_url":"https://api.github.com/repos/Ward9250/Roaring.jl/issues/2","number":2,"state":"open","locked":false,"title":"Array containers","user":{"login":"Ward9250","id":3399309,"avatar_url":"https://avatars.githubusercontent.com/u/3399309?v=3","gravatar_id":"","url":"https://api.github.com/users/Ward9250","html_url":"https://github.com/Ward9250","followers_url":"https://api.github.com/users/Ward9250/followers","following_url":"https://api.github.com/users/Ward9250/following{/other_user}","gists_url":"https://api.github.com/users/Ward9250/gists{/gist_id}","starred_url":"https://api.github.com/users/Ward9250/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ward9250/subscriptions","organizations_url":"https://api.github.com/users/Ward9250/orgs","repos_url":"https://api.github.com/users/Ward9250/repos","events_url":"https://api.github.com/users/Ward9250/events{/privacy}","received_events_url":"https://api.github.com/users/Ward9250/received_events","type":"User","site_admin":false},"body":"See Issue #1 ","created_at":"2016-12-02T15:51:20Z","updated_at":"2016-12-05T14:17:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d7ab7cdaec2851cb9d83ab1629734375bad3741b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Ward9250/Roaring.jl/pulls/2/commits","review_comments_url":"https://api.github.com/repos/Ward9250/Roaring.jl/pulls/2/comments","review_comment_url":"https://api.github.com/repos/Ward9250/Roaring.jl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Ward9250/Roaring.jl/issues/2/comments","statuses_url":"https://api.github.com/repos/Ward9250/Roaring.jl/statuses/70d6b32e0fefd6f22582188be88cd13a3f6568ee","head":{"label":"Ward9250:ArrayContainers","ref":"ArrayContainers","sha":"70d6b32e0fefd6f22582188be88cd13a3f6568ee","user":{"login":"Ward9250","id":3399309,"avatar_url":"https://avatars.githubusercontent.com/u/3399309?v=3","gravatar_id":"","url":"https://api.github.com/users/Ward9250","html_url":"https://github.com/Ward9250","followers_url":"https://api.github.com/users/Ward9250/followers","following_url":"https://api.github.com/users/Ward9250/following{/other_user}","gists_url":"https://api.github.com/users/Ward9250/gists{/gist_id}","starred_url":"https://api.github.com/users/Ward9250/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ward9250/subscriptions","organizations_url":"https://api.github.com/users/Ward9250/orgs","repos_url":"https://api.github.com/users/Ward9250/repos","events_url":"https://api.github.com/users/Ward9250/events{/privacy}","received_events_url":"https://api.github.com/users/Ward9250/received_events","type":"User","site_admin":false},"repo":{"id":74570853,"name":"Roaring.jl","full_name":"Ward9250/Roaring.jl","owner":{"login":"Ward9250","id":3399309,"avatar_url":"https://avatars.githubusercontent.com/u/3399309?v=3","gravatar_id":"","url":"https://api.github.com/users/Ward9250","html_url":"https://github.com/Ward9250","followers_url":"https://api.github.com/users/Ward9250/followers","following_url":"https://api.github.com/users/Ward9250/following{/other_user}","gists_url":"https://api.github.com/users/Ward9250/gists{/gist_id}","starred_url":"https://api.github.com/users/Ward9250/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ward9250/subscriptions","organizations_url":"https://api.github.com/users/Ward9250/orgs","repos_url":"https://api.github.com/users/Ward9250/repos","events_url":"https://api.github.com/users/Ward9250/events{/privacy}","received_events_url":"https://api.github.com/users/Ward9250/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Ward9250/Roaring.jl","description":"Roaring bitmaps for julia","fork":false,"url":"https://api.github.com/repos/Ward9250/Roaring.jl","forks_url":"https://api.github.com/repos/Ward9250/Roaring.jl/forks","keys_url":"https://api.github.com/repos/Ward9250/Roaring.jl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ward9250/Roaring.jl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ward9250/Roaring.jl/teams","hooks_url":"https://api.github.com/repos/Ward9250/Roaring.jl/hooks","issue_events_url":"https://api.github.com/repos/Ward9250/Roaring.jl/issues/events{/number}","events_url":"https://api.github.com/repos/Ward9250/Roaring.jl/events","assignees_url":"https://api.github.com/repos/Ward9250/Roaring.jl/assignees{/user}","branches_url":"https://api.github.com/repos/Ward9250/Roaring.jl/branches{/branch}","tags_url":"https://api.github.com/repos/Ward9250/Roaring.jl/tags","blobs_url":"https://api.github.com/repos/Ward9250/Roaring.jl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ward9250/Roaring.jl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ward9250/Roaring.jl/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ward9250/Roaring.jl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ward9250/Roaring.jl/statuses/{sha}","languages_url":"https://api.github.com/repos/Ward9250/Roaring.jl/languages","stargazers_url":"https://api.github.com/repos/Ward9250/Roaring.jl/stargazers","contributors_url":"https://api.github.com/repos/Ward9250/Roaring.jl/contributors","subscribers_url":"https://api.github.com/repos/Ward9250/Roaring.jl/subscribers","subscription_url":"https://api.github.com/repos/Ward9250/Roaring.jl/subscription","commits_url":"https://api.github.com/repos/Ward9250/Roaring.jl/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ward9250/Roaring.jl/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ward9250/Roaring.jl/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ward9250/Roaring.jl/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ward9250/Roaring.jl/contents/{+path}","compare_url":"https://api.github.com/repos/Ward9250/Roaring.jl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ward9250/Roaring.jl/merges","archive_url":"https://api.github.com/repos/Ward9250/Roaring.jl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ward9250/Roaring.jl/downloads","issues_url":"https://api.github.com/repos/Ward9250/Roaring.jl/issues{/number}","pulls_url":"https://api.github.com/repos/Ward9250/Roaring.jl/pulls{/number}","milestones_url":"https://api.github.com/repos/Ward9250/Roaring.jl/milestones{/number}","notifications_url":"https://api.github.com/repos/Ward9250/Roaring.jl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ward9250/Roaring.jl/labels{/name}","releases_url":"https://api.github.com/repos/Ward9250/Roaring.jl/releases{/id}","deployments_url":"https://api.github.com/repos/Ward9250/Roaring.jl/deployments","created_at":"2016-11-23T11:36:24Z","updated_at":"2016-11-23T11:43:03Z","pushed_at":"2016-12-05T14:13:01Z","git_url":"git://github.com/Ward9250/Roaring.jl.git","ssh_url":"git@github.com:Ward9250/Roaring.jl.git","clone_url":"https://github.com/Ward9250/Roaring.jl.git","svn_url":"https://github.com/Ward9250/Roaring.jl","homepage":"","size":20,"stargazers_count":0,"watchers_count":0,"language":"Julia","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"Ward9250:master","ref":"master","sha":"f9d92810ce6d6c0b7208e852ca69c38f37b22b29","user":{"login":"Ward9250","id":3399309,"avatar_url":"https://avatars.githubusercontent.com/u/3399309?v=3","gravatar_id":"","url":"https://api.github.com/users/Ward9250","html_url":"https://github.com/Ward9250","followers_url":"https://api.github.com/users/Ward9250/followers","following_url":"https://api.github.com/users/Ward9250/following{/other_user}","gists_url":"https://api.github.com/users/Ward9250/gists{/gist_id}","starred_url":"https://api.github.com/users/Ward9250/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ward9250/subscriptions","organizations_url":"https://api.github.com/users/Ward9250/orgs","repos_url":"https://api.github.com/users/Ward9250/repos","events_url":"https://api.github.com/users/Ward9250/events{/privacy}","received_events_url":"https://api.github.com/users/Ward9250/received_events","type":"User","site_admin":false},"repo":{"id":74570853,"name":"Roaring.jl","full_name":"Ward9250/Roaring.jl","owner":{"login":"Ward9250","id":3399309,"avatar_url":"https://avatars.githubusercontent.com/u/3399309?v=3","gravatar_id":"","url":"https://api.github.com/users/Ward9250","html_url":"https://github.com/Ward9250","followers_url":"https://api.github.com/users/Ward9250/followers","following_url":"https://api.github.com/users/Ward9250/following{/other_user}","gists_url":"https://api.github.com/users/Ward9250/gists{/gist_id}","starred_url":"https://api.github.com/users/Ward9250/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ward9250/subscriptions","organizations_url":"https://api.github.com/users/Ward9250/orgs","repos_url":"https://api.github.com/users/Ward9250/repos","events_url":"https://api.github.com/users/Ward9250/events{/privacy}","received_events_url":"https://api.github.com/users/Ward9250/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Ward9250/Roaring.jl","description":"Roaring bitmaps for julia","fork":false,"url":"https://api.github.com/repos/Ward9250/Roaring.jl","forks_url":"https://api.github.com/repos/Ward9250/Roaring.jl/forks","keys_url":"https://api.github.com/repos/Ward9250/Roaring.jl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ward9250/Roaring.jl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ward9250/Roaring.jl/teams","hooks_url":"https://api.github.com/repos/Ward9250/Roaring.jl/hooks","issue_events_url":"https://api.github.com/repos/Ward9250/Roaring.jl/issues/events{/number}","events_url":"https://api.github.com/repos/Ward9250/Roaring.jl/events","assignees_url":"https://api.github.com/repos/Ward9250/Roaring.jl/assignees{/user}","branches_url":"https://api.github.com/repos/Ward9250/Roaring.jl/branches{/branch}","tags_url":"https://api.github.com/repos/Ward9250/Roaring.jl/tags","blobs_url":"https://api.github.com/repos/Ward9250/Roaring.jl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ward9250/Roaring.jl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ward9250/Roaring.jl/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ward9250/Roaring.jl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ward9250/Roaring.jl/statuses/{sha}","languages_url":"https://api.github.com/repos/Ward9250/Roaring.jl/languages","stargazers_url":"https://api.github.com/repos/Ward9250/Roaring.jl/stargazers","contributors_url":"https://api.github.com/repos/Ward9250/Roaring.jl/contributors","subscribers_url":"https://api.github.com/repos/Ward9250/Roaring.jl/subscribers","subscription_url":"https://api.github.com/repos/Ward9250/Roaring.jl/subscription","commits_url":"https://api.github.com/repos/Ward9250/Roaring.jl/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ward9250/Roaring.jl/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ward9250/Roaring.jl/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ward9250/Roaring.jl/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ward9250/Roaring.jl/contents/{+path}","compare_url":"https://api.github.com/repos/Ward9250/Roaring.jl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ward9250/Roaring.jl/merges","archive_url":"https://api.github.com/repos/Ward9250/Roaring.jl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ward9250/Roaring.jl/downloads","issues_url":"https://api.github.com/repos/Ward9250/Roaring.jl/issues{/number}","pulls_url":"https://api.github.com/repos/Ward9250/Roaring.jl/pulls{/number}","milestones_url":"https://api.github.com/repos/Ward9250/Roaring.jl/milestones{/number}","notifications_url":"https://api.github.com/repos/Ward9250/Roaring.jl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ward9250/Roaring.jl/labels{/name}","releases_url":"https://api.github.com/repos/Ward9250/Roaring.jl/releases{/id}","deployments_url":"https://api.github.com/repos/Ward9250/Roaring.jl/deployments","created_at":"2016-11-23T11:36:24Z","updated_at":"2016-11-23T11:43:03Z","pushed_at":"2016-12-05T14:13:01Z","git_url":"git://github.com/Ward9250/Roaring.jl.git","ssh_url":"git@github.com:Ward9250/Roaring.jl.git","clone_url":"https://github.com/Ward9250/Roaring.jl.git","svn_url":"https://github.com/Ward9250/Roaring.jl","homepage":"","size":20,"stargazers_count":0,"watchers_count":0,"language":"Julia","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Ward9250/Roaring.jl/pulls/2"},"html":{"href":"https://github.com/Ward9250/Roaring.jl/pull/2"},"issue":{"href":"https://api.github.com/repos/Ward9250/Roaring.jl/issues/2"},"comments":{"href":"https://api.github.com/repos/Ward9250/Roaring.jl/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/Ward9250/Roaring.jl/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/Ward9250/Roaring.jl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Ward9250/Roaring.jl/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/Ward9250/Roaring.jl/statuses/70d6b32e0fefd6f22582188be88cd13a3f6568ee"}}}}
{"actor":{"display_login":"Ward9250"}}