{"action":"created","issue":{"url":"https://api.github.com/repos/peterc/bitarray/issues/7","repository_url":"https://api.github.com/repos/peterc/bitarray","labels_url":"https://api.github.com/repos/peterc/bitarray/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/peterc/bitarray/issues/7/comments","events_url":"https://api.github.com/repos/peterc/bitarray/issues/7/events","html_url":"https://github.com/peterc/bitarray/issues/7","id":339759338,"node_id":"MDU6SXNzdWUzMzk3NTkzMzg=","number":7,"title":"Issue when setting 0 bit to 0","user":{"login":"tdeo","id":6230277,"node_id":"MDQ6VXNlcjYyMzAyNzc=","avatar_url":"https://avatars1.githubusercontent.com/u/6230277?v=4","gravatar_id":"","url":"https://api.github.com/users/tdeo","html_url":"https://github.com/tdeo","followers_url":"https://api.github.com/users/tdeo/followers","following_url":"https://api.github.com/users/tdeo/following{/other_user}","gists_url":"https://api.github.com/users/tdeo/gists{/gist_id}","starred_url":"https://api.github.com/users/tdeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdeo/subscriptions","organizations_url":"https://api.github.com/users/tdeo/orgs","repos_url":"https://api.github.com/users/tdeo/repos","events_url":"https://api.github.com/users/tdeo/events{/privacy}","received_events_url":"https://api.github.com/users/tdeo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-10T09:19:09Z","updated_at":"2018-08-13T06:08:03Z","closed_at":null,"author_association":"NONE","body":"The following behaviour seems incorrect:\r\n```\r\n2.4.3 :100 > z = BitArray.new(12)\r\n => #<BitArray:0x00007fa023079d18 @size=12, @field=\"\\u0000\\u0000\">\r\n2.4.3 :101 > z[3]\r\n => 0\r\n2.4.3 :102 > z[3] = 0\r\n => 0\r\n2.4.3 :103 > z[3]\r\n => 1\r\n2.4.3 :104 > z[3] = 0\r\n => 0\r\n2.4.3 :105 > z[3]\r\n => 0\r\n2.4.3 :106 > z[3] = 0\r\n => 0\r\n2.4.3 :107 > z[3]\r\n => 1\r\n```\r\n\r\nSetting to `0` should be done with `@field.setbyte(position >> 3, @field.getbyte(position >> 3) & ~(1 << (position % 8)))`\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/peterc/bitarray/issues/comments/412416866","html_url":"https://github.com/peterc/bitarray/issues/7#issuecomment-412416866","issue_url":"https://api.github.com/repos/peterc/bitarray/issues/7","id":412416866,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMjQxNjg2Ng==","user":{"login":"m1lt0n","id":812886,"node_id":"MDQ6VXNlcjgxMjg4Ng==","avatar_url":"https://avatars3.githubusercontent.com/u/812886?v=4","gravatar_id":"","url":"https://api.github.com/users/m1lt0n","html_url":"https://github.com/m1lt0n","followers_url":"https://api.github.com/users/m1lt0n/followers","following_url":"https://api.github.com/users/m1lt0n/following{/other_user}","gists_url":"https://api.github.com/users/m1lt0n/gists{/gist_id}","starred_url":"https://api.github.com/users/m1lt0n/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m1lt0n/subscriptions","organizations_url":"https://api.github.com/users/m1lt0n/orgs","repos_url":"https://api.github.com/users/m1lt0n/repos","events_url":"https://api.github.com/users/m1lt0n/events{/privacy}","received_events_url":"https://api.github.com/users/m1lt0n/received_events","type":"User","site_admin":false},"created_at":"2018-08-13T06:08:03Z","updated_at":"2018-08-13T06:08:03Z","author_association":"NONE","body":"@tdeo Ran into this issue, too and created a slightly different PR. Mentioning here in order to allow the maintainer of the gem close one of the two and merge the other one: #10 "}}
{"actor":{"display_login":"m1lt0n"}}