{"action":"created","comment":{"url":"https://api.github.com/repos/fulcrumgenomics/fgbio/pulls/comments/77387831","id":77387831,"diff_hunk":"@@ -41,6 +41,47 @@ class FgBioDef extends CommonsDef {\n   implicit class BetterBufferedIteratorJavaWrapper[A](val iterator: java.util.Iterator[A]) {\n     def bufferBetter = new BetterBufferedIterator(scala.collection.JavaConversions.asScalaIterator(iterator))\n   }\n+\n+  /**\n+    * An implementation of a for loop that has performance similar to writing a custom\n+    * while loop for primitive types, which suffer great performance loss when iterating\n+    * via foreach(), and especially with zipWithIndex.foreach().\n+    *\n+    * Equivalent to: for(int i=from; i<until; i+=by) f(i)\n+    *\n+    * @param from an initial integer values\n+    * @param until a value one higher than the last value that should be accepted\n+    * @param by a step value to increment by each iteration\n+    * @param f a function that takes the index and is called each iteration\n+    */\n+  @inline def forloop(from: Int, until:Int, by:Int=1)(f: Int => Unit): Unit = {\n+    val comp: (Int,Int) => Boolean = if (by > 0) (_ < _) else (_ > _)\n+    var i = from\n+    while (comp(i, until)) {\n+      f(i)\n+      i += by\n+    }\n+  }\n+\n+  /**\n+    * A more generic for loop, that gives performance similar, but slightly worse than,\n+    * FgBioDef#forloop(Int,Int,Int).  Equivalent to:\n+    *\n+    *  for (i=from; check(i); i=next(i)) f(i)\n+    *\n+    * @param from an initial value\n+    * @param check a function that checks to see if a value should be evaluated (not cause termination)\n+    * @param next a function that takes a value and produced the next value\n+    * @param f a function called on all values\n+    * @tparam T the type of the index\n+    */\n+  @inline @specialized def forloop[T](from: T)(check: T => Boolean)(next: T => T)(f: T => Unit): Unit = {","path":"src/main/scala/com/fulcrumgenomics/FgBioDef.scala","position":38,"original_position":38,"commit_id":"be16b70393ff95c1cc8a7454d78670dfc412ca0d","original_commit_id":"be16b70393ff95c1cc8a7454d78670dfc412ca0d","user":{"login":"nh13","id":846274,"avatar_url":"https://avatars.githubusercontent.com/u/846274?v=3","gravatar_id":"","url":"https://api.github.com/users/nh13","html_url":"https://github.com/nh13","followers_url":"https://api.github.com/users/nh13/followers","following_url":"https://api.github.com/users/nh13/following{/other_user}","gists_url":"https://api.github.com/users/nh13/gists{/gist_id}","starred_url":"https://api.github.com/users/nh13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nh13/subscriptions","organizations_url":"https://api.github.com/users/nh13/orgs","repos_url":"https://api.github.com/users/nh13/repos","events_url":"https://api.github.com/users/nh13/events{/privacy}","received_events_url":"https://api.github.com/users/nh13/received_events","type":"User","site_admin":false},"body":"I am having a hard time understanding if this is the way to use the `@specialized` annotation, for example, see the use of the annotation _within_ the type symbol: http://stackoverflow.com/questions/13173181/specialization-of-generic-functions-in-scala-or-java.  So would it be:\r\n```\r\n@inline def forloop[@specialized(Char, Byte, Int, Long, Double) T](from: T)(check: T => Boolean)(next: T => T)(f: T => Unit): Unit\r\n```\r\n?","created_at":"2016-09-02T18:01:04Z","updated_at":"2016-09-02T18:01:04Z","html_url":"https://github.com/fulcrumgenomics/fgbio/pull/99#discussion_r77387831","pull_request_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/pulls/99","_links":{"self":{"href":"https://api.github.com/repos/fulcrumgenomics/fgbio/pulls/comments/77387831"},"html":{"href":"https://github.com/fulcrumgenomics/fgbio/pull/99#discussion_r77387831"},"pull_request":{"href":"https://api.github.com/repos/fulcrumgenomics/fgbio/pulls/99"}}},"pull_request":{"url":"https://api.github.com/repos/fulcrumgenomics/fgbio/pulls/99","id":83812001,"html_url":"https://github.com/fulcrumgenomics/fgbio/pull/99","diff_url":"https://github.com/fulcrumgenomics/fgbio/pull/99.diff","patch_url":"https://github.com/fulcrumgenomics/fgbio/pull/99.patch","issue_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/issues/99","number":99,"state":"open","locked":false,"title":"A new tool for more efficiently picking sets of long indices.","user":{"login":"tfenne","id":1609210,"avatar_url":"https://avatars.githubusercontent.com/u/1609210?v=3","gravatar_id":"","url":"https://api.github.com/users/tfenne","html_url":"https://github.com/tfenne","followers_url":"https://api.github.com/users/tfenne/followers","following_url":"https://api.github.com/users/tfenne/following{/other_user}","gists_url":"https://api.github.com/users/tfenne/gists{/gist_id}","starred_url":"https://api.github.com/users/tfenne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tfenne/subscriptions","organizations_url":"https://api.github.com/users/tfenne/orgs","repos_url":"https://api.github.com/users/tfenne/repos","events_url":"https://api.github.com/users/tfenne/events{/privacy}","received_events_url":"https://api.github.com/users/tfenne/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-09-02T14:34:59Z","updated_at":"2016-09-02T18:01:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c6a8ea31c358780c264b74b629a07b20cd7d7167","assignee":{"login":"nh13","id":846274,"avatar_url":"https://avatars.githubusercontent.com/u/846274?v=3","gravatar_id":"","url":"https://api.github.com/users/nh13","html_url":"https://github.com/nh13","followers_url":"https://api.github.com/users/nh13/followers","following_url":"https://api.github.com/users/nh13/following{/other_user}","gists_url":"https://api.github.com/users/nh13/gists{/gist_id}","starred_url":"https://api.github.com/users/nh13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nh13/subscriptions","organizations_url":"https://api.github.com/users/nh13/orgs","repos_url":"https://api.github.com/users/nh13/repos","events_url":"https://api.github.com/users/nh13/events{/privacy}","received_events_url":"https://api.github.com/users/nh13/received_events","type":"User","site_admin":false},"assignees":[{"login":"nh13","id":846274,"avatar_url":"https://avatars.githubusercontent.com/u/846274?v=3","gravatar_id":"","url":"https://api.github.com/users/nh13","html_url":"https://github.com/nh13","followers_url":"https://api.github.com/users/nh13/followers","following_url":"https://api.github.com/users/nh13/following{/other_user}","gists_url":"https://api.github.com/users/nh13/gists{/gist_id}","starred_url":"https://api.github.com/users/nh13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nh13/subscriptions","organizations_url":"https://api.github.com/users/nh13/orgs","repos_url":"https://api.github.com/users/nh13/repos","events_url":"https://api.github.com/users/nh13/events{/privacy}","received_events_url":"https://api.github.com/users/nh13/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/pulls/99/commits","review_comments_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/pulls/99/comments","review_comment_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/issues/99/comments","statuses_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/statuses/be16b70393ff95c1cc8a7454d78670dfc412ca0d","head":{"label":"fulcrumgenomics:tf_long_indices","ref":"tf_long_indices","sha":"be16b70393ff95c1cc8a7454d78670dfc412ca0d","user":{"login":"fulcrumgenomics","id":13546013,"avatar_url":"https://avatars.githubusercontent.com/u/13546013?v=3","gravatar_id":"","url":"https://api.github.com/users/fulcrumgenomics","html_url":"https://github.com/fulcrumgenomics","followers_url":"https://api.github.com/users/fulcrumgenomics/followers","following_url":"https://api.github.com/users/fulcrumgenomics/following{/other_user}","gists_url":"https://api.github.com/users/fulcrumgenomics/gists{/gist_id}","starred_url":"https://api.github.com/users/fulcrumgenomics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fulcrumgenomics/subscriptions","organizations_url":"https://api.github.com/users/fulcrumgenomics/orgs","repos_url":"https://api.github.com/users/fulcrumgenomics/repos","events_url":"https://api.github.com/users/fulcrumgenomics/events{/privacy}","received_events_url":"https://api.github.com/users/fulcrumgenomics/received_events","type":"Organization","site_admin":false},"repo":{"id":53011104,"name":"fgbio","full_name":"fulcrumgenomics/fgbio","owner":{"login":"fulcrumgenomics","id":13546013,"avatar_url":"https://avatars.githubusercontent.com/u/13546013?v=3","gravatar_id":"","url":"https://api.github.com/users/fulcrumgenomics","html_url":"https://github.com/fulcrumgenomics","followers_url":"https://api.github.com/users/fulcrumgenomics/followers","following_url":"https://api.github.com/users/fulcrumgenomics/following{/other_user}","gists_url":"https://api.github.com/users/fulcrumgenomics/gists{/gist_id}","starred_url":"https://api.github.com/users/fulcrumgenomics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fulcrumgenomics/subscriptions","organizations_url":"https://api.github.com/users/fulcrumgenomics/orgs","repos_url":"https://api.github.com/users/fulcrumgenomics/repos","events_url":"https://api.github.com/users/fulcrumgenomics/events{/privacy}","received_events_url":"https://api.github.com/users/fulcrumgenomics/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fulcrumgenomics/fgbio","description":"A set of tools for working with genomic and high throughput sequencing data.","fork":false,"url":"https://api.github.com/repos/fulcrumgenomics/fgbio","forks_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/forks","keys_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/teams","hooks_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/hooks","issue_events_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/issues/events{/number}","events_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/events","assignees_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/assignees{/user}","branches_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/branches{/branch}","tags_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/tags","blobs_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/git/refs{/sha}","trees_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/statuses/{sha}","languages_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/languages","stargazers_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/stargazers","contributors_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/contributors","subscribers_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/subscribers","subscription_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/subscription","commits_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/commits{/sha}","git_commits_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/git/commits{/sha}","comments_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/comments{/number}","issue_comment_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/issues/comments{/number}","contents_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/contents/{+path}","compare_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/merges","archive_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/downloads","issues_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/issues{/number}","pulls_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/pulls{/number}","milestones_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/milestones{/number}","notifications_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/labels{/name}","releases_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/releases{/id}","deployments_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/deployments","created_at":"2016-03-03T01:44:56Z","updated_at":"2016-07-08T18:24:48Z","pushed_at":"2016-09-02T17:12:04Z","git_url":"git://github.com/fulcrumgenomics/fgbio.git","ssh_url":"git@github.com:fulcrumgenomics/fgbio.git","clone_url":"https://github.com/fulcrumgenomics/fgbio.git","svn_url":"https://github.com/fulcrumgenomics/fgbio","homepage":"","size":6724,"stargazers_count":3,"watchers_count":3,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":16,"forks":0,"open_issues":16,"watchers":3,"default_branch":"master"}},"base":{"label":"fulcrumgenomics:master","ref":"master","sha":"546f002a7b9a068943fe7736e61cd541a5672a36","user":{"login":"fulcrumgenomics","id":13546013,"avatar_url":"https://avatars.githubusercontent.com/u/13546013?v=3","gravatar_id":"","url":"https://api.github.com/users/fulcrumgenomics","html_url":"https://github.com/fulcrumgenomics","followers_url":"https://api.github.com/users/fulcrumgenomics/followers","following_url":"https://api.github.com/users/fulcrumgenomics/following{/other_user}","gists_url":"https://api.github.com/users/fulcrumgenomics/gists{/gist_id}","starred_url":"https://api.github.com/users/fulcrumgenomics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fulcrumgenomics/subscriptions","organizations_url":"https://api.github.com/users/fulcrumgenomics/orgs","repos_url":"https://api.github.com/users/fulcrumgenomics/repos","events_url":"https://api.github.com/users/fulcrumgenomics/events{/privacy}","received_events_url":"https://api.github.com/users/fulcrumgenomics/received_events","type":"Organization","site_admin":false},"repo":{"id":53011104,"name":"fgbio","full_name":"fulcrumgenomics/fgbio","owner":{"login":"fulcrumgenomics","id":13546013,"avatar_url":"https://avatars.githubusercontent.com/u/13546013?v=3","gravatar_id":"","url":"https://api.github.com/users/fulcrumgenomics","html_url":"https://github.com/fulcrumgenomics","followers_url":"https://api.github.com/users/fulcrumgenomics/followers","following_url":"https://api.github.com/users/fulcrumgenomics/following{/other_user}","gists_url":"https://api.github.com/users/fulcrumgenomics/gists{/gist_id}","starred_url":"https://api.github.com/users/fulcrumgenomics/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fulcrumgenomics/subscriptions","organizations_url":"https://api.github.com/users/fulcrumgenomics/orgs","repos_url":"https://api.github.com/users/fulcrumgenomics/repos","events_url":"https://api.github.com/users/fulcrumgenomics/events{/privacy}","received_events_url":"https://api.github.com/users/fulcrumgenomics/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fulcrumgenomics/fgbio","description":"A set of tools for working with genomic and high throughput sequencing data.","fork":false,"url":"https://api.github.com/repos/fulcrumgenomics/fgbio","forks_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/forks","keys_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/teams","hooks_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/hooks","issue_events_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/issues/events{/number}","events_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/events","assignees_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/assignees{/user}","branches_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/branches{/branch}","tags_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/tags","blobs_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/git/refs{/sha}","trees_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/statuses/{sha}","languages_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/languages","stargazers_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/stargazers","contributors_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/contributors","subscribers_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/subscribers","subscription_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/subscription","commits_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/commits{/sha}","git_commits_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/git/commits{/sha}","comments_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/comments{/number}","issue_comment_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/issues/comments{/number}","contents_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/contents/{+path}","compare_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/merges","archive_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/downloads","issues_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/issues{/number}","pulls_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/pulls{/number}","milestones_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/milestones{/number}","notifications_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/labels{/name}","releases_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/releases{/id}","deployments_url":"https://api.github.com/repos/fulcrumgenomics/fgbio/deployments","created_at":"2016-03-03T01:44:56Z","updated_at":"2016-07-08T18:24:48Z","pushed_at":"2016-09-02T17:12:04Z","git_url":"git://github.com/fulcrumgenomics/fgbio.git","ssh_url":"git@github.com:fulcrumgenomics/fgbio.git","clone_url":"https://github.com/fulcrumgenomics/fgbio.git","svn_url":"https://github.com/fulcrumgenomics/fgbio","homepage":"","size":6724,"stargazers_count":3,"watchers_count":3,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":16,"forks":0,"open_issues":16,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fulcrumgenomics/fgbio/pulls/99"},"html":{"href":"https://github.com/fulcrumgenomics/fgbio/pull/99"},"issue":{"href":"https://api.github.com/repos/fulcrumgenomics/fgbio/issues/99"},"comments":{"href":"https://api.github.com/repos/fulcrumgenomics/fgbio/issues/99/comments"},"review_comments":{"href":"https://api.github.com/repos/fulcrumgenomics/fgbio/pulls/99/comments"},"review_comment":{"href":"https://api.github.com/repos/fulcrumgenomics/fgbio/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fulcrumgenomics/fgbio/pulls/99/commits"},"statuses":{"href":"https://api.github.com/repos/fulcrumgenomics/fgbio/statuses/be16b70393ff95c1cc8a7454d78670dfc412ca0d"}}}}
{"actor":{"display_login":"nh13"}}