{"action":"created","comment":{"url":"https://api.github.com/repos/diamondman/bitarray/pulls/comments/84586575","pull_request_review_id":5357444,"id":84586575,"diff_hunk":"@@ -372,15 +372,20 @@ bitwise(bitarrayobject *self, PyObject *arg, enum op_type oper)\n }\n \n /* set the bits from start to stop (excluding) in self to val */\n-static void\n+idx_t\n setrange(bitarrayobject *self, idx_t start, idx_t stop, int val)\n {\n     idx_t i;\n+    idx_t ret = 0;\n \n     assert(0 <= start && start <= self->nbits);\n-    assert(0 <= stop && stop <= self->nbits);\n+    assert(0 <= stop  && stop  <= self->nbits);\n     for (i = start; i < stop; i++)\n+    {\n+        ret++;\n         setbit(self, i, val);","path":"bitarray/_bitarray.c","position":17,"original_position":17,"commit_id":"c2dceced1de4b21db16e31a6988a2b6577fc78be","original_commit_id":"c2dceced1de4b21db16e31a6988a2b6577fc78be","user":{"login":"diamondman","id":1037510,"avatar_url":"https://avatars.githubusercontent.com/u/1037510?v=3","gravatar_id":"","url":"https://api.github.com/users/diamondman","html_url":"https://github.com/diamondman","followers_url":"https://api.github.com/users/diamondman/followers","following_url":"https://api.github.com/users/diamondman/following{/other_user}","gists_url":"https://api.github.com/users/diamondman/gists{/gist_id}","starred_url":"https://api.github.com/users/diamondman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diamondman/subscriptions","organizations_url":"https://api.github.com/users/diamondman/orgs","repos_url":"https://api.github.com/users/diamondman/repos","events_url":"https://api.github.com/users/diamondman/events{/privacy}","received_events_url":"https://api.github.com/users/diamondman/received_events","type":"User","site_admin":false},"body":"I have a block of code where I do this in C/Python if you would like a reference. Also this is not something that will hold back the patch.","created_at":"2016-10-22T22:29:39Z","updated_at":"2016-10-22T22:29:40Z","html_url":"https://github.com/diamondman/bitarray/pull/3#discussion_r84586575","pull_request_url":"https://api.github.com/repos/diamondman/bitarray/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/diamondman/bitarray/pulls/comments/84586575"},"html":{"href":"https://github.com/diamondman/bitarray/pull/3#discussion_r84586575"},"pull_request":{"href":"https://api.github.com/repos/diamondman/bitarray/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/diamondman/bitarray/pulls/3","id":90495830,"html_url":"https://github.com/diamondman/bitarray/pull/3","diff_url":"https://github.com/diamondman/bitarray/pull/3.diff","patch_url":"https://github.com/diamondman/bitarray/pull/3.patch","issue_url":"https://api.github.com/repos/diamondman/bitarray/issues/3","number":3,"state":"open","locked":false,"title":"add optional pos parameter to start search from","user":{"login":"andre-merzky","id":1319674,"avatar_url":"https://avatars.githubusercontent.com/u/1319674?v=3","gravatar_id":"","url":"https://api.github.com/users/andre-merzky","html_url":"https://github.com/andre-merzky","followers_url":"https://api.github.com/users/andre-merzky/followers","following_url":"https://api.github.com/users/andre-merzky/following{/other_user}","gists_url":"https://api.github.com/users/andre-merzky/gists{/gist_id}","starred_url":"https://api.github.com/users/andre-merzky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andre-merzky/subscriptions","organizations_url":"https://api.github.com/users/andre-merzky/orgs","repos_url":"https://api.github.com/users/andre-merzky/repos","events_url":"https://api.github.com/users/andre-merzky/events{/privacy}","received_events_url":"https://api.github.com/users/andre-merzky/received_events","type":"User","site_admin":false},"body":"This change is backward compatible.  It adds an additional `int` (or rather `ssize_t` typed) pos parameter to `ba.search()`, and the search is started from that position on.  That significantly improves runtime for consecutive searches in large bitarrays.  In my specific use case of searching 1k long, distinct patterns 1M times in a 16MBit array, the time reduced from 80 seconds to 0.5 seconds.\r\n\r\nThis PR was moved over from https://ilanschnell/bitarray/pull/35 .","created_at":"2016-10-22T21:18:37Z","updated_at":"2016-10-22T22:29:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"05d4177faeab108405991188ccb4e187c955d371","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/diamondman/bitarray/pulls/3/commits","review_comments_url":"https://api.github.com/repos/diamondman/bitarray/pulls/3/comments","review_comment_url":"https://api.github.com/repos/diamondman/bitarray/pulls/comments{/number}","comments_url":"https://api.github.com/repos/diamondman/bitarray/issues/3/comments","statuses_url":"https://api.github.com/repos/diamondman/bitarray/statuses/c2dceced1de4b21db16e31a6988a2b6577fc78be","head":{"label":"andre-merzky:feature/search_from_pos","ref":"feature/search_from_pos","sha":"c2dceced1de4b21db16e31a6988a2b6577fc78be","user":{"login":"andre-merzky","id":1319674,"avatar_url":"https://avatars.githubusercontent.com/u/1319674?v=3","gravatar_id":"","url":"https://api.github.com/users/andre-merzky","html_url":"https://github.com/andre-merzky","followers_url":"https://api.github.com/users/andre-merzky/followers","following_url":"https://api.github.com/users/andre-merzky/following{/other_user}","gists_url":"https://api.github.com/users/andre-merzky/gists{/gist_id}","starred_url":"https://api.github.com/users/andre-merzky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andre-merzky/subscriptions","organizations_url":"https://api.github.com/users/andre-merzky/orgs","repos_url":"https://api.github.com/users/andre-merzky/repos","events_url":"https://api.github.com/users/andre-merzky/events{/privacy}","received_events_url":"https://api.github.com/users/andre-merzky/received_events","type":"User","site_admin":false},"repo":{"id":58637150,"name":"bitarray","full_name":"andre-merzky/bitarray","owner":{"login":"andre-merzky","id":1319674,"avatar_url":"https://avatars.githubusercontent.com/u/1319674?v=3","gravatar_id":"","url":"https://api.github.com/users/andre-merzky","html_url":"https://github.com/andre-merzky","followers_url":"https://api.github.com/users/andre-merzky/followers","following_url":"https://api.github.com/users/andre-merzky/following{/other_user}","gists_url":"https://api.github.com/users/andre-merzky/gists{/gist_id}","starred_url":"https://api.github.com/users/andre-merzky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andre-merzky/subscriptions","organizations_url":"https://api.github.com/users/andre-merzky/orgs","repos_url":"https://api.github.com/users/andre-merzky/repos","events_url":"https://api.github.com/users/andre-merzky/events{/privacy}","received_events_url":"https://api.github.com/users/andre-merzky/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andre-merzky/bitarray","description":"efficient arrays of booleans for Python","fork":true,"url":"https://api.github.com/repos/andre-merzky/bitarray","forks_url":"https://api.github.com/repos/andre-merzky/bitarray/forks","keys_url":"https://api.github.com/repos/andre-merzky/bitarray/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andre-merzky/bitarray/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andre-merzky/bitarray/teams","hooks_url":"https://api.github.com/repos/andre-merzky/bitarray/hooks","issue_events_url":"https://api.github.com/repos/andre-merzky/bitarray/issues/events{/number}","events_url":"https://api.github.com/repos/andre-merzky/bitarray/events","assignees_url":"https://api.github.com/repos/andre-merzky/bitarray/assignees{/user}","branches_url":"https://api.github.com/repos/andre-merzky/bitarray/branches{/branch}","tags_url":"https://api.github.com/repos/andre-merzky/bitarray/tags","blobs_url":"https://api.github.com/repos/andre-merzky/bitarray/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andre-merzky/bitarray/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andre-merzky/bitarray/git/refs{/sha}","trees_url":"https://api.github.com/repos/andre-merzky/bitarray/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andre-merzky/bitarray/statuses/{sha}","languages_url":"https://api.github.com/repos/andre-merzky/bitarray/languages","stargazers_url":"https://api.github.com/repos/andre-merzky/bitarray/stargazers","contributors_url":"https://api.github.com/repos/andre-merzky/bitarray/contributors","subscribers_url":"https://api.github.com/repos/andre-merzky/bitarray/subscribers","subscription_url":"https://api.github.com/repos/andre-merzky/bitarray/subscription","commits_url":"https://api.github.com/repos/andre-merzky/bitarray/commits{/sha}","git_commits_url":"https://api.github.com/repos/andre-merzky/bitarray/git/commits{/sha}","comments_url":"https://api.github.com/repos/andre-merzky/bitarray/comments{/number}","issue_comment_url":"https://api.github.com/repos/andre-merzky/bitarray/issues/comments{/number}","contents_url":"https://api.github.com/repos/andre-merzky/bitarray/contents/{+path}","compare_url":"https://api.github.com/repos/andre-merzky/bitarray/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andre-merzky/bitarray/merges","archive_url":"https://api.github.com/repos/andre-merzky/bitarray/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andre-merzky/bitarray/downloads","issues_url":"https://api.github.com/repos/andre-merzky/bitarray/issues{/number}","pulls_url":"https://api.github.com/repos/andre-merzky/bitarray/pulls{/number}","milestones_url":"https://api.github.com/repos/andre-merzky/bitarray/milestones{/number}","notifications_url":"https://api.github.com/repos/andre-merzky/bitarray/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andre-merzky/bitarray/labels{/name}","releases_url":"https://api.github.com/repos/andre-merzky/bitarray/releases{/id}","deployments_url":"https://api.github.com/repos/andre-merzky/bitarray/deployments","created_at":"2016-05-12T11:52:31Z","updated_at":"2016-05-12T11:52:31Z","pushed_at":"2016-10-22T22:03:42Z","git_url":"git://github.com/andre-merzky/bitarray.git","ssh_url":"git@github.com:andre-merzky/bitarray.git","clone_url":"https://github.com/andre-merzky/bitarray.git","svn_url":"https://github.com/andre-merzky/bitarray","homepage":"","size":302,"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":"master"}},"base":{"label":"diamondman:master","ref":"master","sha":"e566c9007763961c46c234bfadbdb42510ee1e39","user":{"login":"diamondman","id":1037510,"avatar_url":"https://avatars.githubusercontent.com/u/1037510?v=3","gravatar_id":"","url":"https://api.github.com/users/diamondman","html_url":"https://github.com/diamondman","followers_url":"https://api.github.com/users/diamondman/followers","following_url":"https://api.github.com/users/diamondman/following{/other_user}","gists_url":"https://api.github.com/users/diamondman/gists{/gist_id}","starred_url":"https://api.github.com/users/diamondman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diamondman/subscriptions","organizations_url":"https://api.github.com/users/diamondman/orgs","repos_url":"https://api.github.com/users/diamondman/repos","events_url":"https://api.github.com/users/diamondman/events{/privacy}","received_events_url":"https://api.github.com/users/diamondman/received_events","type":"User","site_admin":false},"repo":{"id":71019584,"name":"bitarray","full_name":"diamondman/bitarray","owner":{"login":"diamondman","id":1037510,"avatar_url":"https://avatars.githubusercontent.com/u/1037510?v=3","gravatar_id":"","url":"https://api.github.com/users/diamondman","html_url":"https://github.com/diamondman","followers_url":"https://api.github.com/users/diamondman/followers","following_url":"https://api.github.com/users/diamondman/following{/other_user}","gists_url":"https://api.github.com/users/diamondman/gists{/gist_id}","starred_url":"https://api.github.com/users/diamondman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diamondman/subscriptions","organizations_url":"https://api.github.com/users/diamondman/orgs","repos_url":"https://api.github.com/users/diamondman/repos","events_url":"https://api.github.com/users/diamondman/events{/privacy}","received_events_url":"https://api.github.com/users/diamondman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/diamondman/bitarray","description":"efficient arrays of booleans for Python","fork":true,"url":"https://api.github.com/repos/diamondman/bitarray","forks_url":"https://api.github.com/repos/diamondman/bitarray/forks","keys_url":"https://api.github.com/repos/diamondman/bitarray/keys{/key_id}","collaborators_url":"https://api.github.com/repos/diamondman/bitarray/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/diamondman/bitarray/teams","hooks_url":"https://api.github.com/repos/diamondman/bitarray/hooks","issue_events_url":"https://api.github.com/repos/diamondman/bitarray/issues/events{/number}","events_url":"https://api.github.com/repos/diamondman/bitarray/events","assignees_url":"https://api.github.com/repos/diamondman/bitarray/assignees{/user}","branches_url":"https://api.github.com/repos/diamondman/bitarray/branches{/branch}","tags_url":"https://api.github.com/repos/diamondman/bitarray/tags","blobs_url":"https://api.github.com/repos/diamondman/bitarray/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/diamondman/bitarray/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/diamondman/bitarray/git/refs{/sha}","trees_url":"https://api.github.com/repos/diamondman/bitarray/git/trees{/sha}","statuses_url":"https://api.github.com/repos/diamondman/bitarray/statuses/{sha}","languages_url":"https://api.github.com/repos/diamondman/bitarray/languages","stargazers_url":"https://api.github.com/repos/diamondman/bitarray/stargazers","contributors_url":"https://api.github.com/repos/diamondman/bitarray/contributors","subscribers_url":"https://api.github.com/repos/diamondman/bitarray/subscribers","subscription_url":"https://api.github.com/repos/diamondman/bitarray/subscription","commits_url":"https://api.github.com/repos/diamondman/bitarray/commits{/sha}","git_commits_url":"https://api.github.com/repos/diamondman/bitarray/git/commits{/sha}","comments_url":"https://api.github.com/repos/diamondman/bitarray/comments{/number}","issue_comment_url":"https://api.github.com/repos/diamondman/bitarray/issues/comments{/number}","contents_url":"https://api.github.com/repos/diamondman/bitarray/contents/{+path}","compare_url":"https://api.github.com/repos/diamondman/bitarray/compare/{base}...{head}","merges_url":"https://api.github.com/repos/diamondman/bitarray/merges","archive_url":"https://api.github.com/repos/diamondman/bitarray/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/diamondman/bitarray/downloads","issues_url":"https://api.github.com/repos/diamondman/bitarray/issues{/number}","pulls_url":"https://api.github.com/repos/diamondman/bitarray/pulls{/number}","milestones_url":"https://api.github.com/repos/diamondman/bitarray/milestones{/number}","notifications_url":"https://api.github.com/repos/diamondman/bitarray/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/diamondman/bitarray/labels{/name}","releases_url":"https://api.github.com/repos/diamondman/bitarray/releases{/id}","deployments_url":"https://api.github.com/repos/diamondman/bitarray/deployments","created_at":"2016-10-15T23:30:47Z","updated_at":"2016-10-22T17:45:36Z","pushed_at":"2016-10-22T22:03:43Z","git_url":"git://github.com/diamondman/bitarray.git","ssh_url":"git@github.com:diamondman/bitarray.git","clone_url":"https://github.com/diamondman/bitarray.git","svn_url":"https://github.com/diamondman/bitarray","homepage":"","size":330,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/diamondman/bitarray/pulls/3"},"html":{"href":"https://github.com/diamondman/bitarray/pull/3"},"issue":{"href":"https://api.github.com/repos/diamondman/bitarray/issues/3"},"comments":{"href":"https://api.github.com/repos/diamondman/bitarray/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/diamondman/bitarray/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/diamondman/bitarray/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/diamondman/bitarray/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/diamondman/bitarray/statuses/c2dceced1de4b21db16e31a6988a2b6577fc78be"}}}}
{"actor":{"display_login":"diamondman"}}