{"action":"created","comment":{"url":"https://api.github.com/repos/hammerlab/ketrew/pulls/comments/43287997","id":43287997,"diff_hunk":"@@ -1,41 +1,38 @@\n open Ketrew_pure.Internal_pervasives\n open Unix_io\n \n+(* A parametric circular buffer. *)\n module Ring = struct\n   type 'a t = {\n     recent: 'a option array;\n     mutable index: int;\n-\n   }\n+\n   let create ?(size = 4200) () =\n     {recent = Array.make size None; index = 0}\n \n   let add t v =\n     t.recent.(t.index) <- Some v;\n-    begin match (t.index + 1) with\n-    | i when i = (Array.length t.recent) -> t.index <- 0\n-    | other -> t.index <- (t.index + 1);\n-    end;\n-    ()\n+    t.index <- (t.index + 1) mod (Array.length t.recent)\n \n-  let fold t ~init ~f =\n+  let fold_right t ~init ~f =\n+    let l = Array.length t.recent in\n+    let p i = (i - 1 + l) mod l in\n     let rec go count prev index =\n       let next item = f prev item in\n       match index, t.recent.(index) with\n       | _, None -> prev\n-      | _, _ when count = Array.length t.recent -> prev\n-      | 0, Some s ->\n-        go (count + 1) (next s) (Array.length t.recent - 1)\n+      | _, _ when count = l -> prev\n       | n, Some s ->\n-        go (count + 1) (next s) (n - 1)\n+        go (count + 1) (next s) (p n)\n     in\n-    if t.index = 0 then go 0 init (Array.length t.recent - 1) else go 0 init (t.index - 1) \n+    go 0 init (p t.index)","path":"src/lib/logging.ml","position":41,"original_position":41,"commit_id":"81db565f16638a743a2ecc89788dd02fb2f32648","original_commit_id":"81db565f16638a743a2ecc89788dd02fb2f32648","user":{"login":"smondet","id":617111,"avatar_url":"https://avatars.githubusercontent.com/u/617111?v=3","gravatar_id":"","url":"https://api.github.com/users/smondet","html_url":"https://github.com/smondet","followers_url":"https://api.github.com/users/smondet/followers","following_url":"https://api.github.com/users/smondet/following{/other_user}","gists_url":"https://api.github.com/users/smondet/gists{/gist_id}","starred_url":"https://api.github.com/users/smondet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smondet/subscriptions","organizations_url":"https://api.github.com/users/smondet/orgs","repos_url":"https://api.github.com/users/smondet/repos","events_url":"https://api.github.com/users/smondet/events{/privacy}","received_events_url":"https://api.github.com/users/smondet/received_events","type":"User","site_admin":false},"body":"Which arguments?\r\n\r\n","created_at":"2015-10-28T17:20:19Z","updated_at":"2015-10-28T17:20:19Z","html_url":"https://github.com/hammerlab/ketrew/pull/230#discussion_r43287997","pull_request_url":"https://api.github.com/repos/hammerlab/ketrew/pulls/230","_links":{"self":{"href":"https://api.github.com/repos/hammerlab/ketrew/pulls/comments/43287997"},"html":{"href":"https://github.com/hammerlab/ketrew/pull/230#discussion_r43287997"},"pull_request":{"href":"https://api.github.com/repos/hammerlab/ketrew/pulls/230"}}},"pull_request":{"url":"https://api.github.com/repos/hammerlab/ketrew/pulls/230","id":48958758,"html_url":"https://github.com/hammerlab/ketrew/pull/230","diff_url":"https://github.com/hammerlab/ketrew/pull/230.diff","patch_url":"https://github.com/hammerlab/ketrew/pull/230.patch","issue_url":"https://api.github.com/repos/hammerlab/ketrew/issues/230","number":230,"state":"open","locked":false,"title":"Mostly stylistic changes based around server","user":{"login":"rleonid","id":6570317,"avatar_url":"https://avatars.githubusercontent.com/u/6570317?v=3","gravatar_id":"","url":"https://api.github.com/users/rleonid","html_url":"https://github.com/rleonid","followers_url":"https://api.github.com/users/rleonid/followers","following_url":"https://api.github.com/users/rleonid/following{/other_user}","gists_url":"https://api.github.com/users/rleonid/gists{/gist_id}","starred_url":"https://api.github.com/users/rleonid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rleonid/subscriptions","organizations_url":"https://api.github.com/users/rleonid/orgs","repos_url":"https://api.github.com/users/rleonid/repos","events_url":"https://api.github.com/users/rleonid/events{/privacy}","received_events_url":"https://api.github.com/users/rleonid/received_events","type":"User","site_admin":false},"body":"In the interest of smaller, more manageable patches, I'm going to open up a PR at this point. Even though this branch does not address my desire to fix the `=` bug.\n\n<!-- Reviewable:start -->\n[<img src=\"https://reviewable.io/review_button.png\" height=40 alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/hammerlab/ketrew/230)\n<!-- Reviewable:end -->\n","created_at":"2015-10-28T02:45:58Z","updated_at":"2015-10-28T17:20:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"74f8db229fc5e098cc5f0cf6865bb429ceccf83d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hammerlab/ketrew/pulls/230/commits","review_comments_url":"https://api.github.com/repos/hammerlab/ketrew/pulls/230/comments","review_comment_url":"https://api.github.com/repos/hammerlab/ketrew/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hammerlab/ketrew/issues/230/comments","statuses_url":"https://api.github.com/repos/hammerlab/ketrew/statuses/81db565f16638a743a2ecc89788dd02fb2f32648","head":{"label":"hammerlab:client_equal_side_weirdness","ref":"client_equal_side_weirdness","sha":"81db565f16638a743a2ecc89788dd02fb2f32648","user":{"login":"hammerlab","id":6563873,"avatar_url":"https://avatars.githubusercontent.com/u/6563873?v=3","gravatar_id":"","url":"https://api.github.com/users/hammerlab","html_url":"https://github.com/hammerlab","followers_url":"https://api.github.com/users/hammerlab/followers","following_url":"https://api.github.com/users/hammerlab/following{/other_user}","gists_url":"https://api.github.com/users/hammerlab/gists{/gist_id}","starred_url":"https://api.github.com/users/hammerlab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hammerlab/subscriptions","organizations_url":"https://api.github.com/users/hammerlab/orgs","repos_url":"https://api.github.com/users/hammerlab/repos","events_url":"https://api.github.com/users/hammerlab/events{/privacy}","received_events_url":"https://api.github.com/users/hammerlab/received_events","type":"Organization","site_admin":false},"repo":{"id":20244903,"name":"ketrew","full_name":"hammerlab/ketrew","owner":{"login":"hammerlab","id":6563873,"avatar_url":"https://avatars.githubusercontent.com/u/6563873?v=3","gravatar_id":"","url":"https://api.github.com/users/hammerlab","html_url":"https://github.com/hammerlab","followers_url":"https://api.github.com/users/hammerlab/followers","following_url":"https://api.github.com/users/hammerlab/following{/other_user}","gists_url":"https://api.github.com/users/hammerlab/gists{/gist_id}","starred_url":"https://api.github.com/users/hammerlab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hammerlab/subscriptions","organizations_url":"https://api.github.com/users/hammerlab/orgs","repos_url":"https://api.github.com/users/hammerlab/repos","events_url":"https://api.github.com/users/hammerlab/events{/privacy}","received_events_url":"https://api.github.com/users/hammerlab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hammerlab/ketrew","description":"Keep Track of Experimental Workflows","fork":false,"url":"https://api.github.com/repos/hammerlab/ketrew","forks_url":"https://api.github.com/repos/hammerlab/ketrew/forks","keys_url":"https://api.github.com/repos/hammerlab/ketrew/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hammerlab/ketrew/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hammerlab/ketrew/teams","hooks_url":"https://api.github.com/repos/hammerlab/ketrew/hooks","issue_events_url":"https://api.github.com/repos/hammerlab/ketrew/issues/events{/number}","events_url":"https://api.github.com/repos/hammerlab/ketrew/events","assignees_url":"https://api.github.com/repos/hammerlab/ketrew/assignees{/user}","branches_url":"https://api.github.com/repos/hammerlab/ketrew/branches{/branch}","tags_url":"https://api.github.com/repos/hammerlab/ketrew/tags","blobs_url":"https://api.github.com/repos/hammerlab/ketrew/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hammerlab/ketrew/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hammerlab/ketrew/git/refs{/sha}","trees_url":"https://api.github.com/repos/hammerlab/ketrew/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hammerlab/ketrew/statuses/{sha}","languages_url":"https://api.github.com/repos/hammerlab/ketrew/languages","stargazers_url":"https://api.github.com/repos/hammerlab/ketrew/stargazers","contributors_url":"https://api.github.com/repos/hammerlab/ketrew/contributors","subscribers_url":"https://api.github.com/repos/hammerlab/ketrew/subscribers","subscription_url":"https://api.github.com/repos/hammerlab/ketrew/subscription","commits_url":"https://api.github.com/repos/hammerlab/ketrew/commits{/sha}","git_commits_url":"https://api.github.com/repos/hammerlab/ketrew/git/commits{/sha}","comments_url":"https://api.github.com/repos/hammerlab/ketrew/comments{/number}","issue_comment_url":"https://api.github.com/repos/hammerlab/ketrew/issues/comments{/number}","contents_url":"https://api.github.com/repos/hammerlab/ketrew/contents/{+path}","compare_url":"https://api.github.com/repos/hammerlab/ketrew/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hammerlab/ketrew/merges","archive_url":"https://api.github.com/repos/hammerlab/ketrew/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hammerlab/ketrew/downloads","issues_url":"https://api.github.com/repos/hammerlab/ketrew/issues{/number}","pulls_url":"https://api.github.com/repos/hammerlab/ketrew/pulls{/number}","milestones_url":"https://api.github.com/repos/hammerlab/ketrew/milestones{/number}","notifications_url":"https://api.github.com/repos/hammerlab/ketrew/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hammerlab/ketrew/labels{/name}","releases_url":"https://api.github.com/repos/hammerlab/ketrew/releases{/id}","created_at":"2014-05-28T04:18:29Z","updated_at":"2015-10-21T07:52:34Z","pushed_at":"2015-10-28T16:26:07Z","git_url":"git://github.com/hammerlab/ketrew.git","ssh_url":"git@github.com:hammerlab/ketrew.git","clone_url":"https://github.com/hammerlab/ketrew.git","svn_url":"https://github.com/hammerlab/ketrew","homepage":"http://seb.mondet.org/software/ketrew/","size":3843,"stargazers_count":27,"watchers_count":27,"language":"OCaml","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":60,"forks":5,"open_issues":60,"watchers":27,"default_branch":"master"}},"base":{"label":"hammerlab:master","ref":"master","sha":"32680627f765a81de8d34c8ef4e967b09f61d55a","user":{"login":"hammerlab","id":6563873,"avatar_url":"https://avatars.githubusercontent.com/u/6563873?v=3","gravatar_id":"","url":"https://api.github.com/users/hammerlab","html_url":"https://github.com/hammerlab","followers_url":"https://api.github.com/users/hammerlab/followers","following_url":"https://api.github.com/users/hammerlab/following{/other_user}","gists_url":"https://api.github.com/users/hammerlab/gists{/gist_id}","starred_url":"https://api.github.com/users/hammerlab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hammerlab/subscriptions","organizations_url":"https://api.github.com/users/hammerlab/orgs","repos_url":"https://api.github.com/users/hammerlab/repos","events_url":"https://api.github.com/users/hammerlab/events{/privacy}","received_events_url":"https://api.github.com/users/hammerlab/received_events","type":"Organization","site_admin":false},"repo":{"id":20244903,"name":"ketrew","full_name":"hammerlab/ketrew","owner":{"login":"hammerlab","id":6563873,"avatar_url":"https://avatars.githubusercontent.com/u/6563873?v=3","gravatar_id":"","url":"https://api.github.com/users/hammerlab","html_url":"https://github.com/hammerlab","followers_url":"https://api.github.com/users/hammerlab/followers","following_url":"https://api.github.com/users/hammerlab/following{/other_user}","gists_url":"https://api.github.com/users/hammerlab/gists{/gist_id}","starred_url":"https://api.github.com/users/hammerlab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hammerlab/subscriptions","organizations_url":"https://api.github.com/users/hammerlab/orgs","repos_url":"https://api.github.com/users/hammerlab/repos","events_url":"https://api.github.com/users/hammerlab/events{/privacy}","received_events_url":"https://api.github.com/users/hammerlab/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hammerlab/ketrew","description":"Keep Track of Experimental Workflows","fork":false,"url":"https://api.github.com/repos/hammerlab/ketrew","forks_url":"https://api.github.com/repos/hammerlab/ketrew/forks","keys_url":"https://api.github.com/repos/hammerlab/ketrew/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hammerlab/ketrew/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hammerlab/ketrew/teams","hooks_url":"https://api.github.com/repos/hammerlab/ketrew/hooks","issue_events_url":"https://api.github.com/repos/hammerlab/ketrew/issues/events{/number}","events_url":"https://api.github.com/repos/hammerlab/ketrew/events","assignees_url":"https://api.github.com/repos/hammerlab/ketrew/assignees{/user}","branches_url":"https://api.github.com/repos/hammerlab/ketrew/branches{/branch}","tags_url":"https://api.github.com/repos/hammerlab/ketrew/tags","blobs_url":"https://api.github.com/repos/hammerlab/ketrew/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hammerlab/ketrew/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hammerlab/ketrew/git/refs{/sha}","trees_url":"https://api.github.com/repos/hammerlab/ketrew/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hammerlab/ketrew/statuses/{sha}","languages_url":"https://api.github.com/repos/hammerlab/ketrew/languages","stargazers_url":"https://api.github.com/repos/hammerlab/ketrew/stargazers","contributors_url":"https://api.github.com/repos/hammerlab/ketrew/contributors","subscribers_url":"https://api.github.com/repos/hammerlab/ketrew/subscribers","subscription_url":"https://api.github.com/repos/hammerlab/ketrew/subscription","commits_url":"https://api.github.com/repos/hammerlab/ketrew/commits{/sha}","git_commits_url":"https://api.github.com/repos/hammerlab/ketrew/git/commits{/sha}","comments_url":"https://api.github.com/repos/hammerlab/ketrew/comments{/number}","issue_comment_url":"https://api.github.com/repos/hammerlab/ketrew/issues/comments{/number}","contents_url":"https://api.github.com/repos/hammerlab/ketrew/contents/{+path}","compare_url":"https://api.github.com/repos/hammerlab/ketrew/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hammerlab/ketrew/merges","archive_url":"https://api.github.com/repos/hammerlab/ketrew/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hammerlab/ketrew/downloads","issues_url":"https://api.github.com/repos/hammerlab/ketrew/issues{/number}","pulls_url":"https://api.github.com/repos/hammerlab/ketrew/pulls{/number}","milestones_url":"https://api.github.com/repos/hammerlab/ketrew/milestones{/number}","notifications_url":"https://api.github.com/repos/hammerlab/ketrew/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hammerlab/ketrew/labels{/name}","releases_url":"https://api.github.com/repos/hammerlab/ketrew/releases{/id}","created_at":"2014-05-28T04:18:29Z","updated_at":"2015-10-21T07:52:34Z","pushed_at":"2015-10-28T16:26:07Z","git_url":"git://github.com/hammerlab/ketrew.git","ssh_url":"git@github.com:hammerlab/ketrew.git","clone_url":"https://github.com/hammerlab/ketrew.git","svn_url":"https://github.com/hammerlab/ketrew","homepage":"http://seb.mondet.org/software/ketrew/","size":3843,"stargazers_count":27,"watchers_count":27,"language":"OCaml","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":60,"forks":5,"open_issues":60,"watchers":27,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hammerlab/ketrew/pulls/230"},"html":{"href":"https://github.com/hammerlab/ketrew/pull/230"},"issue":{"href":"https://api.github.com/repos/hammerlab/ketrew/issues/230"},"comments":{"href":"https://api.github.com/repos/hammerlab/ketrew/issues/230/comments"},"review_comments":{"href":"https://api.github.com/repos/hammerlab/ketrew/pulls/230/comments"},"review_comment":{"href":"https://api.github.com/repos/hammerlab/ketrew/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hammerlab/ketrew/pulls/230/commits"},"statuses":{"href":"https://api.github.com/repos/hammerlab/ketrew/statuses/81db565f16638a743a2ecc89788dd02fb2f32648"}}}}