{"action":"created","comment":{"url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/pulls/comments/191921130","pull_request_review_id":124590902,"id":191921130,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MTkyMTEzMA==","diff_hunk":"@@ -15,17 +15,20 @@ const elo = ([...ratings], kFactor = 32, selfRating) => {\n   const expectedScore = (self, opponent) => 1 / (1 + 10 ** ((opponent - self) / 400));\n   const newRating = (rating, i) =>\n     (selfRating || rating) + kFactor * (i - expectedScore(i ? a : b, i ? b : a));\n+    \n   if (ratings.length === 2) {\n     return [newRating(a, 1), newRating(b, 0)];\n-  } else {\n-    for (let i = 0; i < ratings.length; i++) {\n-      let j = i;\n-      while (j < ratings.length - 1) {\n-        [ratings[i], ratings[j + 1]] = elo([ratings[i], ratings[j + 1]], kFactor);\n-        j++;\n-      }\n+  } \n+  \n+  for (let i = 0, l = ratings.length; i < l; i++) {","path":"snippets/elo.md","position":16,"original_position":16,"commit_id":"49b8c11f36ee793d252246b045be539b62277169","original_commit_id":"49b8c11f36ee793d252246b045be539b62277169","user":{"login":"Chalarangelo","id":8281875,"node_id":"MDQ6VXNlcjgyODE4NzU=","avatar_url":"https://avatars2.githubusercontent.com/u/8281875?v=4","gravatar_id":"","url":"https://api.github.com/users/Chalarangelo","html_url":"https://github.com/Chalarangelo","followers_url":"https://api.github.com/users/Chalarangelo/followers","following_url":"https://api.github.com/users/Chalarangelo/following{/other_user}","gists_url":"https://api.github.com/users/Chalarangelo/gists{/gist_id}","starred_url":"https://api.github.com/users/Chalarangelo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chalarangelo/subscriptions","organizations_url":"https://api.github.com/users/Chalarangelo/orgs","repos_url":"https://api.github.com/users/Chalarangelo/repos","events_url":"https://api.github.com/users/Chalarangelo/events{/privacy}","received_events_url":"https://api.github.com/users/Chalarangelo/received_events","type":"User","site_admin":false},"body":"`i` and `j` as iterators are fine (they are also part of the guidelines). `len` or `length` for the length should be a bit better than the current name.","created_at":"2018-05-30T20:59:39Z","updated_at":"2018-05-30T20:59:39Z","html_url":"https://github.com/Chalarangelo/30-seconds-of-code/pull/671#discussion_r191921130","pull_request_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/pulls/671","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/pulls/comments/191921130"},"html":{"href":"https://github.com/Chalarangelo/30-seconds-of-code/pull/671#discussion_r191921130"},"pull_request":{"href":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/pulls/671"}},"in_reply_to_id":191913899},"pull_request":{"url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/pulls/671","id":191505518,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkxNTA1NTE4","html_url":"https://github.com/Chalarangelo/30-seconds-of-code/pull/671","diff_url":"https://github.com/Chalarangelo/30-seconds-of-code/pull/671.diff","patch_url":"https://github.com/Chalarangelo/30-seconds-of-code/pull/671.patch","issue_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/issues/671","number":671,"state":"open","locked":false,"title":"ELO snippet formatting + performance","user":{"login":"OutThisLife","id":770929,"node_id":"MDQ6VXNlcjc3MDkyOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/770929?v=4","gravatar_id":"","url":"https://api.github.com/users/OutThisLife","html_url":"https://github.com/OutThisLife","followers_url":"https://api.github.com/users/OutThisLife/followers","following_url":"https://api.github.com/users/OutThisLife/following{/other_user}","gists_url":"https://api.github.com/users/OutThisLife/gists{/gist_id}","starred_url":"https://api.github.com/users/OutThisLife/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OutThisLife/subscriptions","organizations_url":"https://api.github.com/users/OutThisLife/orgs","repos_url":"https://api.github.com/users/OutThisLife/repos","events_url":"https://api.github.com/users/OutThisLife/events{/privacy}","received_events_url":"https://api.github.com/users/OutThisLife/received_events","type":"User","site_admin":false},"body":"Not assigning `arr.length` to a variable in a for loop means that the read is done on every iteration.\r\n\r\n<!--- Provide a general summary of your changes in the Title above -->\r\n\r\n<!--- Add the prefix [FIX: #(issue number)], [FEATURE] or [ENHANCEMENT] to the Title -->\r\n\r\n## Description\r\n<!--- Describe your changes in detail -->\r\n**Resolves** #(issue number) <!--- Delete if not a issue fix-->\r\n\r\n## What does your PR belong to?\r\n- [x] Website\r\n- [x] Snippets\r\n- [ ] General / Things regarding the repository (like CI Integration)\r\n- [ ] Tests\r\n\r\n## Types of changes\r\n- [ ] Bug fix (non-breaking change which fixes an issue)\r\n- [x] Enhancement (non-breaking improvement of a snippet)\r\n- [ ] New feature (non-breaking change which adds functionality)\r\n- [ ] Breaking change (fix or feature that would cause existing functionality to change)\r\n\r\n## Checklist:\r\n<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->\r\n- [x] My code follows the code style of this project.\r\n- [ ] My change requires a change to the documentation.\r\n- [ ] I have updated the documentation accordingly.\r\n- [x] I have checked that the changes are working properly\r\n- [x] I have checked that there isn't any PR doing the same\r\n- [x] I have read the **CONTRIBUTING** document.\r\n","created_at":"2018-05-30T16:07:18Z","updated_at":"2018-05-30T20:59:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"16bbb4a9178b5a4421ee8a69bd93456ecad4cdda","assignee":null,"assignees":[],"requested_reviewers":[{"login":"fejes713","id":25749162,"node_id":"MDQ6VXNlcjI1NzQ5MTYy","avatar_url":"https://avatars2.githubusercontent.com/u/25749162?v=4","gravatar_id":"","url":"https://api.github.com/users/fejes713","html_url":"https://github.com/fejes713","followers_url":"https://api.github.com/users/fejes713/followers","following_url":"https://api.github.com/users/fejes713/following{/other_user}","gists_url":"https://api.github.com/users/fejes713/gists{/gist_id}","starred_url":"https://api.github.com/users/fejes713/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fejes713/subscriptions","organizations_url":"https://api.github.com/users/fejes713/orgs","repos_url":"https://api.github.com/users/fejes713/repos","events_url":"https://api.github.com/users/fejes713/events{/privacy}","received_events_url":"https://api.github.com/users/fejes713/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":777547240,"node_id":"MDU6TGFiZWw3Nzc1NDcyNDA=","url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/labels/on%20hold","name":"on hold","color":"493baf","default":false},{"id":779011655,"node_id":"MDU6TGFiZWw3NzkwMTE2NTU=","url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/labels/opinions%20needed","name":"opinions needed","color":"f458ab","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/pulls/671/commits","review_comments_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/pulls/671/comments","review_comment_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/issues/671/comments","statuses_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/statuses/49b8c11f36ee793d252246b045be539b62277169","head":{"label":"OutThisLife:patch-1","ref":"patch-1","sha":"49b8c11f36ee793d252246b045be539b62277169","user":{"login":"OutThisLife","id":770929,"node_id":"MDQ6VXNlcjc3MDkyOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/770929?v=4","gravatar_id":"","url":"https://api.github.com/users/OutThisLife","html_url":"https://github.com/OutThisLife","followers_url":"https://api.github.com/users/OutThisLife/followers","following_url":"https://api.github.com/users/OutThisLife/following{/other_user}","gists_url":"https://api.github.com/users/OutThisLife/gists{/gist_id}","starred_url":"https://api.github.com/users/OutThisLife/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OutThisLife/subscriptions","organizations_url":"https://api.github.com/users/OutThisLife/orgs","repos_url":"https://api.github.com/users/OutThisLife/repos","events_url":"https://api.github.com/users/OutThisLife/events{/privacy}","received_events_url":"https://api.github.com/users/OutThisLife/received_events","type":"User","site_admin":false},"repo":{"id":135467315,"node_id":"MDEwOlJlcG9zaXRvcnkxMzU0NjczMTU=","name":"30-seconds-of-code","full_name":"OutThisLife/30-seconds-of-code","owner":{"login":"OutThisLife","id":770929,"node_id":"MDQ6VXNlcjc3MDkyOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/770929?v=4","gravatar_id":"","url":"https://api.github.com/users/OutThisLife","html_url":"https://github.com/OutThisLife","followers_url":"https://api.github.com/users/OutThisLife/followers","following_url":"https://api.github.com/users/OutThisLife/following{/other_user}","gists_url":"https://api.github.com/users/OutThisLife/gists{/gist_id}","starred_url":"https://api.github.com/users/OutThisLife/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OutThisLife/subscriptions","organizations_url":"https://api.github.com/users/OutThisLife/orgs","repos_url":"https://api.github.com/users/OutThisLife/repos","events_url":"https://api.github.com/users/OutThisLife/events{/privacy}","received_events_url":"https://api.github.com/users/OutThisLife/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/OutThisLife/30-seconds-of-code","description":"Curated collection of useful Javascript snippets that you can understand in 30 seconds or less.","fork":true,"url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code","forks_url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code/forks","keys_url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code/teams","hooks_url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code/hooks","issue_events_url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code/issues/events{/number}","events_url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code/events","assignees_url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code/assignees{/user}","branches_url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code/branches{/branch}","tags_url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code/tags","blobs_url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code/git/refs{/sha}","trees_url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code/statuses/{sha}","languages_url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code/languages","stargazers_url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code/stargazers","contributors_url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code/contributors","subscribers_url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code/subscribers","subscription_url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code/subscription","commits_url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code/commits{/sha}","git_commits_url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code/git/commits{/sha}","comments_url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code/comments{/number}","issue_comment_url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code/issues/comments{/number}","contents_url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code/contents/{+path}","compare_url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code/merges","archive_url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code/downloads","issues_url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code/issues{/number}","pulls_url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code/pulls{/number}","milestones_url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code/milestones{/number}","notifications_url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code/labels{/name}","releases_url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code/releases{/id}","deployments_url":"https://api.github.com/repos/OutThisLife/30-seconds-of-code/deployments","created_at":"2018-05-30T16:05:09Z","updated_at":"2018-05-30T16:05:12Z","pushed_at":"2018-05-30T16:07:11Z","git_url":"git://github.com/OutThisLife/30-seconds-of-code.git","ssh_url":"git@github.com:OutThisLife/30-seconds-of-code.git","clone_url":"https://github.com/OutThisLife/30-seconds-of-code.git","svn_url":"https://github.com/OutThisLife/30-seconds-of-code","homepage":"https://30secondsofcode.org/","size":8117,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"cc0-1.0","name":"Creative Commons Zero v1.0 Universal","spdx_id":"CC0-1.0","url":"https://api.github.com/licenses/cc0-1.0","node_id":"MDc6TGljZW5zZTY="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Chalarangelo:master","ref":"master","sha":"bdd7eff9329f11bd1c59277a52e865e0eb349dc3","user":{"login":"Chalarangelo","id":8281875,"node_id":"MDQ6VXNlcjgyODE4NzU=","avatar_url":"https://avatars2.githubusercontent.com/u/8281875?v=4","gravatar_id":"","url":"https://api.github.com/users/Chalarangelo","html_url":"https://github.com/Chalarangelo","followers_url":"https://api.github.com/users/Chalarangelo/followers","following_url":"https://api.github.com/users/Chalarangelo/following{/other_user}","gists_url":"https://api.github.com/users/Chalarangelo/gists{/gist_id}","starred_url":"https://api.github.com/users/Chalarangelo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chalarangelo/subscriptions","organizations_url":"https://api.github.com/users/Chalarangelo/orgs","repos_url":"https://api.github.com/users/Chalarangelo/repos","events_url":"https://api.github.com/users/Chalarangelo/events{/privacy}","received_events_url":"https://api.github.com/users/Chalarangelo/received_events","type":"User","site_admin":false},"repo":{"id":112507086,"node_id":"MDEwOlJlcG9zaXRvcnkxMTI1MDcwODY=","name":"30-seconds-of-code","full_name":"Chalarangelo/30-seconds-of-code","owner":{"login":"Chalarangelo","id":8281875,"node_id":"MDQ6VXNlcjgyODE4NzU=","avatar_url":"https://avatars2.githubusercontent.com/u/8281875?v=4","gravatar_id":"","url":"https://api.github.com/users/Chalarangelo","html_url":"https://github.com/Chalarangelo","followers_url":"https://api.github.com/users/Chalarangelo/followers","following_url":"https://api.github.com/users/Chalarangelo/following{/other_user}","gists_url":"https://api.github.com/users/Chalarangelo/gists{/gist_id}","starred_url":"https://api.github.com/users/Chalarangelo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chalarangelo/subscriptions","organizations_url":"https://api.github.com/users/Chalarangelo/orgs","repos_url":"https://api.github.com/users/Chalarangelo/repos","events_url":"https://api.github.com/users/Chalarangelo/events{/privacy}","received_events_url":"https://api.github.com/users/Chalarangelo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Chalarangelo/30-seconds-of-code","description":"Curated collection of useful Javascript snippets that you can understand in 30 seconds or less.","fork":false,"url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code","forks_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/forks","keys_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/teams","hooks_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/hooks","issue_events_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/issues/events{/number}","events_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/events","assignees_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/assignees{/user}","branches_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/branches{/branch}","tags_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/tags","blobs_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/git/refs{/sha}","trees_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/statuses/{sha}","languages_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/languages","stargazers_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/stargazers","contributors_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/contributors","subscribers_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/subscribers","subscription_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/subscription","commits_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/commits{/sha}","git_commits_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/git/commits{/sha}","comments_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/comments{/number}","issue_comment_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/issues/comments{/number}","contents_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/contents/{+path}","compare_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/merges","archive_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/downloads","issues_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/issues{/number}","pulls_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/pulls{/number}","milestones_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/milestones{/number}","notifications_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/labels{/name}","releases_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/releases{/id}","deployments_url":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/deployments","created_at":"2017-11-29T17:35:03Z","updated_at":"2018-05-30T20:59:09Z","pushed_at":"2018-05-30T16:51:54Z","git_url":"git://github.com/Chalarangelo/30-seconds-of-code.git","ssh_url":"git@github.com:Chalarangelo/30-seconds-of-code.git","clone_url":"https://github.com/Chalarangelo/30-seconds-of-code.git","svn_url":"https://github.com/Chalarangelo/30-seconds-of-code","homepage":"https://30secondsofcode.org/","size":8271,"stargazers_count":20244,"watchers_count":20244,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2044,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"cc0-1.0","name":"Creative Commons Zero v1.0 Universal","spdx_id":"CC0-1.0","url":"https://api.github.com/licenses/cc0-1.0","node_id":"MDc6TGljZW5zZTY="},"forks":2044,"open_issues":4,"watchers":20244,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/pulls/671"},"html":{"href":"https://github.com/Chalarangelo/30-seconds-of-code/pull/671"},"issue":{"href":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/issues/671"},"comments":{"href":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/issues/671/comments"},"review_comments":{"href":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/pulls/671/comments"},"review_comment":{"href":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/pulls/671/commits"},"statuses":{"href":"https://api.github.com/repos/Chalarangelo/30-seconds-of-code/statuses/49b8c11f36ee793d252246b045be539b62277169"}},"author_association":"NONE"}}
{"actor":{"display_login":"Chalarangelo"}}