{"action":"created","comment":{"url":"https://api.github.com/repos/elixir-lang/plug/pulls/comments/101169758","pull_request_review_id":21891161,"id":101169758,"diff_hunk":"@@ -37,11 +37,7 @@ defmodule Plug.Adapters.Cowboy.Conn do\n   def send_file(req, status, headers, path, offset, length) do\n     %File.Stat{type: :regular, size: size} = File.stat!(path)\n \n-    length =\n-      cond do\n-        length == :all -> size\n-        is_integer(length) -> length\n-      end\n+    length = if length == :all, do: size, else: length","path":"lib/plug/adapters/cowboy/conn.ex","position":9,"original_position":9,"commit_id":"70c168f34fc4609ae562b1b4a9bf07c955341e36","original_commit_id":"70c168f34fc4609ae562b1b4a9bf07c955341e36","user":{"login":"josevalim","id":9582,"avatar_url":"https://avatars.githubusercontent.com/u/9582?v=3","gravatar_id":"","url":"https://api.github.com/users/josevalim","html_url":"https://github.com/josevalim","followers_url":"https://api.github.com/users/josevalim/followers","following_url":"https://api.github.com/users/josevalim/following{/other_user}","gists_url":"https://api.github.com/users/josevalim/gists{/gist_id}","starred_url":"https://api.github.com/users/josevalim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josevalim/subscriptions","organizations_url":"https://api.github.com/users/josevalim/orgs","repos_url":"https://api.github.com/users/josevalim/repos","events_url":"https://api.github.com/users/josevalim/events{/privacy}","received_events_url":"https://api.github.com/users/josevalim/received_events","type":"User","site_admin":false},"body":"So the semnatics here are not the same. The previous code would error if length is not an integer or `:all`. I would keep this code as is.","created_at":"2017-02-14T23:24:22Z","updated_at":"2017-02-14T23:24:22Z","html_url":"https://github.com/elixir-lang/plug/pull/514#discussion_r101169758","pull_request_url":"https://api.github.com/repos/elixir-lang/plug/pulls/514","_links":{"self":{"href":"https://api.github.com/repos/elixir-lang/plug/pulls/comments/101169758"},"html":{"href":"https://github.com/elixir-lang/plug/pull/514#discussion_r101169758"},"pull_request":{"href":"https://api.github.com/repos/elixir-lang/plug/pulls/514"}}},"pull_request":{"url":"https://api.github.com/repos/elixir-lang/plug/pulls/514","id":106170208,"html_url":"https://github.com/elixir-lang/plug/pull/514","diff_url":"https://github.com/elixir-lang/plug/pull/514.diff","patch_url":"https://github.com/elixir-lang/plug/pull/514.patch","issue_url":"https://api.github.com/repos/elixir-lang/plug/issues/514","number":514,"state":"open","locked":false,"title":"Minor refactoring","user":{"login":"milmazz","id":34700,"avatar_url":"https://avatars.githubusercontent.com/u/34700?v=3","gravatar_id":"","url":"https://api.github.com/users/milmazz","html_url":"https://github.com/milmazz","followers_url":"https://api.github.com/users/milmazz/followers","following_url":"https://api.github.com/users/milmazz/following{/other_user}","gists_url":"https://api.github.com/users/milmazz/gists{/gist_id}","starred_url":"https://api.github.com/users/milmazz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/milmazz/subscriptions","organizations_url":"https://api.github.com/users/milmazz/orgs","repos_url":"https://api.github.com/users/milmazz/repos","events_url":"https://api.github.com/users/milmazz/events{/privacy}","received_events_url":"https://api.github.com/users/milmazz/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-02-14T19:03:12Z","updated_at":"2017-02-14T23:24:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"87b606ba7cdde24a355792da79d3de2883f7f42f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/elixir-lang/plug/pulls/514/commits","review_comments_url":"https://api.github.com/repos/elixir-lang/plug/pulls/514/comments","review_comment_url":"https://api.github.com/repos/elixir-lang/plug/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elixir-lang/plug/issues/514/comments","statuses_url":"https://api.github.com/repos/elixir-lang/plug/statuses/70c168f34fc4609ae562b1b4a9bf07c955341e36","head":{"label":"milmazz:minor-refactoring","ref":"minor-refactoring","sha":"70c168f34fc4609ae562b1b4a9bf07c955341e36","user":{"login":"milmazz","id":34700,"avatar_url":"https://avatars.githubusercontent.com/u/34700?v=3","gravatar_id":"","url":"https://api.github.com/users/milmazz","html_url":"https://github.com/milmazz","followers_url":"https://api.github.com/users/milmazz/followers","following_url":"https://api.github.com/users/milmazz/following{/other_user}","gists_url":"https://api.github.com/users/milmazz/gists{/gist_id}","starred_url":"https://api.github.com/users/milmazz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/milmazz/subscriptions","organizations_url":"https://api.github.com/users/milmazz/orgs","repos_url":"https://api.github.com/users/milmazz/repos","events_url":"https://api.github.com/users/milmazz/events{/privacy}","received_events_url":"https://api.github.com/users/milmazz/received_events","type":"User","site_admin":false},"repo":{"id":45085650,"name":"plug","full_name":"milmazz/plug","owner":{"login":"milmazz","id":34700,"avatar_url":"https://avatars.githubusercontent.com/u/34700?v=3","gravatar_id":"","url":"https://api.github.com/users/milmazz","html_url":"https://github.com/milmazz","followers_url":"https://api.github.com/users/milmazz/followers","following_url":"https://api.github.com/users/milmazz/following{/other_user}","gists_url":"https://api.github.com/users/milmazz/gists{/gist_id}","starred_url":"https://api.github.com/users/milmazz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/milmazz/subscriptions","organizations_url":"https://api.github.com/users/milmazz/orgs","repos_url":"https://api.github.com/users/milmazz/repos","events_url":"https://api.github.com/users/milmazz/events{/privacy}","received_events_url":"https://api.github.com/users/milmazz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/milmazz/plug","description":"A specification and conveniences for composable modules between web applications","fork":true,"url":"https://api.github.com/repos/milmazz/plug","forks_url":"https://api.github.com/repos/milmazz/plug/forks","keys_url":"https://api.github.com/repos/milmazz/plug/keys{/key_id}","collaborators_url":"https://api.github.com/repos/milmazz/plug/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/milmazz/plug/teams","hooks_url":"https://api.github.com/repos/milmazz/plug/hooks","issue_events_url":"https://api.github.com/repos/milmazz/plug/issues/events{/number}","events_url":"https://api.github.com/repos/milmazz/plug/events","assignees_url":"https://api.github.com/repos/milmazz/plug/assignees{/user}","branches_url":"https://api.github.com/repos/milmazz/plug/branches{/branch}","tags_url":"https://api.github.com/repos/milmazz/plug/tags","blobs_url":"https://api.github.com/repos/milmazz/plug/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/milmazz/plug/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/milmazz/plug/git/refs{/sha}","trees_url":"https://api.github.com/repos/milmazz/plug/git/trees{/sha}","statuses_url":"https://api.github.com/repos/milmazz/plug/statuses/{sha}","languages_url":"https://api.github.com/repos/milmazz/plug/languages","stargazers_url":"https://api.github.com/repos/milmazz/plug/stargazers","contributors_url":"https://api.github.com/repos/milmazz/plug/contributors","subscribers_url":"https://api.github.com/repos/milmazz/plug/subscribers","subscription_url":"https://api.github.com/repos/milmazz/plug/subscription","commits_url":"https://api.github.com/repos/milmazz/plug/commits{/sha}","git_commits_url":"https://api.github.com/repos/milmazz/plug/git/commits{/sha}","comments_url":"https://api.github.com/repos/milmazz/plug/comments{/number}","issue_comment_url":"https://api.github.com/repos/milmazz/plug/issues/comments{/number}","contents_url":"https://api.github.com/repos/milmazz/plug/contents/{+path}","compare_url":"https://api.github.com/repos/milmazz/plug/compare/{base}...{head}","merges_url":"https://api.github.com/repos/milmazz/plug/merges","archive_url":"https://api.github.com/repos/milmazz/plug/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/milmazz/plug/downloads","issues_url":"https://api.github.com/repos/milmazz/plug/issues{/number}","pulls_url":"https://api.github.com/repos/milmazz/plug/pulls{/number}","milestones_url":"https://api.github.com/repos/milmazz/plug/milestones{/number}","notifications_url":"https://api.github.com/repos/milmazz/plug/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/milmazz/plug/labels{/name}","releases_url":"https://api.github.com/repos/milmazz/plug/releases{/id}","deployments_url":"https://api.github.com/repos/milmazz/plug/deployments","created_at":"2015-10-28T03:10:35Z","updated_at":"2015-10-28T03:10:36Z","pushed_at":"2017-02-14T22:39:54Z","git_url":"git://github.com/milmazz/plug.git","ssh_url":"git@github.com:milmazz/plug.git","clone_url":"https://github.com/milmazz/plug.git","svn_url":"https://github.com/milmazz/plug","homepage":"","size":1506,"stargazers_count":0,"watchers_count":0,"language":"Elixir","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"elixir-lang:master","ref":"master","sha":"8c7574c428e339c60bb93acdf77fb4f7565cc108","user":{"login":"elixir-lang","id":1481354,"avatar_url":"https://avatars.githubusercontent.com/u/1481354?v=3","gravatar_id":"","url":"https://api.github.com/users/elixir-lang","html_url":"https://github.com/elixir-lang","followers_url":"https://api.github.com/users/elixir-lang/followers","following_url":"https://api.github.com/users/elixir-lang/following{/other_user}","gists_url":"https://api.github.com/users/elixir-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/elixir-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elixir-lang/subscriptions","organizations_url":"https://api.github.com/users/elixir-lang/orgs","repos_url":"https://api.github.com/users/elixir-lang/repos","events_url":"https://api.github.com/users/elixir-lang/events{/privacy}","received_events_url":"https://api.github.com/users/elixir-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":14421569,"name":"plug","full_name":"elixir-lang/plug","owner":{"login":"elixir-lang","id":1481354,"avatar_url":"https://avatars.githubusercontent.com/u/1481354?v=3","gravatar_id":"","url":"https://api.github.com/users/elixir-lang","html_url":"https://github.com/elixir-lang","followers_url":"https://api.github.com/users/elixir-lang/followers","following_url":"https://api.github.com/users/elixir-lang/following{/other_user}","gists_url":"https://api.github.com/users/elixir-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/elixir-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elixir-lang/subscriptions","organizations_url":"https://api.github.com/users/elixir-lang/orgs","repos_url":"https://api.github.com/users/elixir-lang/repos","events_url":"https://api.github.com/users/elixir-lang/events{/privacy}","received_events_url":"https://api.github.com/users/elixir-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elixir-lang/plug","description":"A specification and conveniences for composable modules between web applications","fork":false,"url":"https://api.github.com/repos/elixir-lang/plug","forks_url":"https://api.github.com/repos/elixir-lang/plug/forks","keys_url":"https://api.github.com/repos/elixir-lang/plug/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elixir-lang/plug/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elixir-lang/plug/teams","hooks_url":"https://api.github.com/repos/elixir-lang/plug/hooks","issue_events_url":"https://api.github.com/repos/elixir-lang/plug/issues/events{/number}","events_url":"https://api.github.com/repos/elixir-lang/plug/events","assignees_url":"https://api.github.com/repos/elixir-lang/plug/assignees{/user}","branches_url":"https://api.github.com/repos/elixir-lang/plug/branches{/branch}","tags_url":"https://api.github.com/repos/elixir-lang/plug/tags","blobs_url":"https://api.github.com/repos/elixir-lang/plug/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elixir-lang/plug/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elixir-lang/plug/git/refs{/sha}","trees_url":"https://api.github.com/repos/elixir-lang/plug/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elixir-lang/plug/statuses/{sha}","languages_url":"https://api.github.com/repos/elixir-lang/plug/languages","stargazers_url":"https://api.github.com/repos/elixir-lang/plug/stargazers","contributors_url":"https://api.github.com/repos/elixir-lang/plug/contributors","subscribers_url":"https://api.github.com/repos/elixir-lang/plug/subscribers","subscription_url":"https://api.github.com/repos/elixir-lang/plug/subscription","commits_url":"https://api.github.com/repos/elixir-lang/plug/commits{/sha}","git_commits_url":"https://api.github.com/repos/elixir-lang/plug/git/commits{/sha}","comments_url":"https://api.github.com/repos/elixir-lang/plug/comments{/number}","issue_comment_url":"https://api.github.com/repos/elixir-lang/plug/issues/comments{/number}","contents_url":"https://api.github.com/repos/elixir-lang/plug/contents/{+path}","compare_url":"https://api.github.com/repos/elixir-lang/plug/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elixir-lang/plug/merges","archive_url":"https://api.github.com/repos/elixir-lang/plug/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elixir-lang/plug/downloads","issues_url":"https://api.github.com/repos/elixir-lang/plug/issues{/number}","pulls_url":"https://api.github.com/repos/elixir-lang/plug/pulls{/number}","milestones_url":"https://api.github.com/repos/elixir-lang/plug/milestones{/number}","notifications_url":"https://api.github.com/repos/elixir-lang/plug/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elixir-lang/plug/labels{/name}","releases_url":"https://api.github.com/repos/elixir-lang/plug/releases{/id}","deployments_url":"https://api.github.com/repos/elixir-lang/plug/deployments","created_at":"2013-11-15T10:30:47Z","updated_at":"2017-02-14T07:44:16Z","pushed_at":"2017-02-14T23:23:32Z","git_url":"git://github.com/elixir-lang/plug.git","ssh_url":"git@github.com:elixir-lang/plug.git","clone_url":"https://github.com/elixir-lang/plug.git","svn_url":"https://github.com/elixir-lang/plug","homepage":"","size":1513,"stargazers_count":1252,"watchers_count":1252,"language":"Elixir","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":251,"mirror_url":null,"open_issues_count":8,"forks":251,"open_issues":8,"watchers":1252,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elixir-lang/plug/pulls/514"},"html":{"href":"https://github.com/elixir-lang/plug/pull/514"},"issue":{"href":"https://api.github.com/repos/elixir-lang/plug/issues/514"},"comments":{"href":"https://api.github.com/repos/elixir-lang/plug/issues/514/comments"},"review_comments":{"href":"https://api.github.com/repos/elixir-lang/plug/pulls/514/comments"},"review_comment":{"href":"https://api.github.com/repos/elixir-lang/plug/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elixir-lang/plug/pulls/514/commits"},"statuses":{"href":"https://api.github.com/repos/elixir-lang/plug/statuses/70c168f34fc4609ae562b1b4a9bf07c955341e36"}}}}
{"actor":{"display_login":"josevalim"}}