{"action":"created","comment":{"url":"https://api.github.com/repos/caolan/async/pulls/comments/81994440","pull_request_review_id":2932978,"id":81994440,"diff_hunk":"@@ -1,31 +1,19 @@\n-import arrayMap from 'lodash/_arrayMap';\n-import property from 'lodash/_baseProperty';\n+import filter from 'lodash/_arrayFilter';\n import noop from 'lodash/noop';\n import once from './once';\n \n export default function _filter(eachfn, arr, iteratee, callback) {\n     callback = once(callback || noop);\n-    var results = [];\n+    var truthy = [];","path":"lib/internal/filter.js","position":10,"original_position":10,"commit_id":"8695676064402b5744af9597ffc889c9e0cd15b9","original_commit_id":"8695676064402b5744af9597ffc889c9e0cd15b9","user":{"login":"megawac","id":3475472,"avatar_url":"https://avatars.githubusercontent.com/u/3475472?v=3","gravatar_id":"","url":"https://api.github.com/users/megawac","html_url":"https://github.com/megawac","followers_url":"https://api.github.com/users/megawac/followers","following_url":"https://api.github.com/users/megawac/following{/other_user}","gists_url":"https://api.github.com/users/megawac/gists{/gist_id}","starred_url":"https://api.github.com/users/megawac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/megawac/subscriptions","organizations_url":"https://api.github.com/users/megawac/orgs","repos_url":"https://api.github.com/users/megawac/repos","events_url":"https://api.github.com/users/megawac/events{/privacy}","received_events_url":"https://api.github.com/users/megawac/received_events","type":"User","site_admin":false},"body":"Can we change this variable to to something like `var truthyIndexes` or `filteredIndexes`.\r\n\r\nI'd also be curious about the performance of making an array of accepted indexes rather than a truthy list of indexes:\r\n\r\nFor instance an array might look like `[1, 5, 6]` if we wanted to take those indexes\r\n\r\nthe final filter array building step would look like\r\n\r\n```js\r\nvar length = filteredIndexes.length;\r\nvar results = new Array(length)\r\nfor (var i = 0; i < length; i++) {\r\n   results[i] = arr[filteredIndexes[i]];\r\n}\r\nreturn results\r\n```\r\n\r\nI'd expect this to be faster","created_at":"2016-10-05T15:05:04Z","updated_at":"2016-10-05T15:05:19Z","html_url":"https://github.com/caolan/async/pull/1297#discussion_r81994440","pull_request_url":"https://api.github.com/repos/caolan/async/pulls/1297","_links":{"self":{"href":"https://api.github.com/repos/caolan/async/pulls/comments/81994440"},"html":{"href":"https://github.com/caolan/async/pull/1297#discussion_r81994440"},"pull_request":{"href":"https://api.github.com/repos/caolan/async/pulls/1297"}}},"pull_request":{"url":"https://api.github.com/repos/caolan/async/pulls/1297","id":88085583,"html_url":"https://github.com/caolan/async/pull/1297","diff_url":"https://github.com/caolan/async/pull/1297.diff","patch_url":"https://github.com/caolan/async/pull/1297.patch","issue_url":"https://api.github.com/repos/caolan/async/issues/1297","number":1297,"state":"open","locked":false,"title":"Improve filter by reducing complexity.","user":{"login":"CodeMan99","id":6373201,"avatar_url":"https://avatars.githubusercontent.com/u/6373201?v=3","gravatar_id":"","url":"https://api.github.com/users/CodeMan99","html_url":"https://github.com/CodeMan99","followers_url":"https://api.github.com/users/CodeMan99/followers","following_url":"https://api.github.com/users/CodeMan99/following{/other_user}","gists_url":"https://api.github.com/users/CodeMan99/gists{/gist_id}","starred_url":"https://api.github.com/users/CodeMan99/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CodeMan99/subscriptions","organizations_url":"https://api.github.com/users/CodeMan99/orgs","repos_url":"https://api.github.com/users/CodeMan99/repos","events_url":"https://api.github.com/users/CodeMan99/events{/privacy}","received_events_url":"https://api.github.com/users/CodeMan99/received_events","type":"User","site_admin":false},"body":"This change reduces the complexity of `filter` by removing the need to sort the asynchronous result.\r\n\r\nInstead, simply map to a temporary array with the truthy state. In the each function callback filter the original array with the truthy state at the same index.","created_at":"2016-10-05T14:11:55Z","updated_at":"2016-10-05T15:05:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b39a4ded9a05e1528506d9c999dca5ae3d5788de","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/caolan/async/pulls/1297/commits","review_comments_url":"https://api.github.com/repos/caolan/async/pulls/1297/comments","review_comment_url":"https://api.github.com/repos/caolan/async/pulls/comments{/number}","comments_url":"https://api.github.com/repos/caolan/async/issues/1297/comments","statuses_url":"https://api.github.com/repos/caolan/async/statuses/8695676064402b5744af9597ffc889c9e0cd15b9","head":{"label":"CodeMan99:master","ref":"master","sha":"8695676064402b5744af9597ffc889c9e0cd15b9","user":{"login":"CodeMan99","id":6373201,"avatar_url":"https://avatars.githubusercontent.com/u/6373201?v=3","gravatar_id":"","url":"https://api.github.com/users/CodeMan99","html_url":"https://github.com/CodeMan99","followers_url":"https://api.github.com/users/CodeMan99/followers","following_url":"https://api.github.com/users/CodeMan99/following{/other_user}","gists_url":"https://api.github.com/users/CodeMan99/gists{/gist_id}","starred_url":"https://api.github.com/users/CodeMan99/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CodeMan99/subscriptions","organizations_url":"https://api.github.com/users/CodeMan99/orgs","repos_url":"https://api.github.com/users/CodeMan99/repos","events_url":"https://api.github.com/users/CodeMan99/events{/privacy}","received_events_url":"https://api.github.com/users/CodeMan99/received_events","type":"User","site_admin":false},"repo":{"id":70063462,"name":"async","full_name":"CodeMan99/async","owner":{"login":"CodeMan99","id":6373201,"avatar_url":"https://avatars.githubusercontent.com/u/6373201?v=3","gravatar_id":"","url":"https://api.github.com/users/CodeMan99","html_url":"https://github.com/CodeMan99","followers_url":"https://api.github.com/users/CodeMan99/followers","following_url":"https://api.github.com/users/CodeMan99/following{/other_user}","gists_url":"https://api.github.com/users/CodeMan99/gists{/gist_id}","starred_url":"https://api.github.com/users/CodeMan99/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CodeMan99/subscriptions","organizations_url":"https://api.github.com/users/CodeMan99/orgs","repos_url":"https://api.github.com/users/CodeMan99/repos","events_url":"https://api.github.com/users/CodeMan99/events{/privacy}","received_events_url":"https://api.github.com/users/CodeMan99/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/CodeMan99/async","description":"Async utilities for node and the browser","fork":true,"url":"https://api.github.com/repos/CodeMan99/async","forks_url":"https://api.github.com/repos/CodeMan99/async/forks","keys_url":"https://api.github.com/repos/CodeMan99/async/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CodeMan99/async/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CodeMan99/async/teams","hooks_url":"https://api.github.com/repos/CodeMan99/async/hooks","issue_events_url":"https://api.github.com/repos/CodeMan99/async/issues/events{/number}","events_url":"https://api.github.com/repos/CodeMan99/async/events","assignees_url":"https://api.github.com/repos/CodeMan99/async/assignees{/user}","branches_url":"https://api.github.com/repos/CodeMan99/async/branches{/branch}","tags_url":"https://api.github.com/repos/CodeMan99/async/tags","blobs_url":"https://api.github.com/repos/CodeMan99/async/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CodeMan99/async/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CodeMan99/async/git/refs{/sha}","trees_url":"https://api.github.com/repos/CodeMan99/async/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CodeMan99/async/statuses/{sha}","languages_url":"https://api.github.com/repos/CodeMan99/async/languages","stargazers_url":"https://api.github.com/repos/CodeMan99/async/stargazers","contributors_url":"https://api.github.com/repos/CodeMan99/async/contributors","subscribers_url":"https://api.github.com/repos/CodeMan99/async/subscribers","subscription_url":"https://api.github.com/repos/CodeMan99/async/subscription","commits_url":"https://api.github.com/repos/CodeMan99/async/commits{/sha}","git_commits_url":"https://api.github.com/repos/CodeMan99/async/git/commits{/sha}","comments_url":"https://api.github.com/repos/CodeMan99/async/comments{/number}","issue_comment_url":"https://api.github.com/repos/CodeMan99/async/issues/comments{/number}","contents_url":"https://api.github.com/repos/CodeMan99/async/contents/{+path}","compare_url":"https://api.github.com/repos/CodeMan99/async/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CodeMan99/async/merges","archive_url":"https://api.github.com/repos/CodeMan99/async/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CodeMan99/async/downloads","issues_url":"https://api.github.com/repos/CodeMan99/async/issues{/number}","pulls_url":"https://api.github.com/repos/CodeMan99/async/pulls{/number}","milestones_url":"https://api.github.com/repos/CodeMan99/async/milestones{/number}","notifications_url":"https://api.github.com/repos/CodeMan99/async/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CodeMan99/async/labels{/name}","releases_url":"https://api.github.com/repos/CodeMan99/async/releases{/id}","deployments_url":"https://api.github.com/repos/CodeMan99/async/deployments","created_at":"2016-10-05T13:32:27Z","updated_at":"2016-10-05T13:32:29Z","pushed_at":"2016-10-05T14:52:08Z","git_url":"git://github.com/CodeMan99/async.git","ssh_url":"git@github.com:CodeMan99/async.git","clone_url":"https://github.com/CodeMan99/async.git","svn_url":"https://github.com/CodeMan99/async","homepage":"http://caolan.github.io/async/","size":3795,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"caolan:master","ref":"master","sha":"0d2dbf74b846aa923b492cd42e4d04e279dd32ec","user":{"login":"caolan","id":5274,"avatar_url":"https://avatars.githubusercontent.com/u/5274?v=3","gravatar_id":"","url":"https://api.github.com/users/caolan","html_url":"https://github.com/caolan","followers_url":"https://api.github.com/users/caolan/followers","following_url":"https://api.github.com/users/caolan/following{/other_user}","gists_url":"https://api.github.com/users/caolan/gists{/gist_id}","starred_url":"https://api.github.com/users/caolan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caolan/subscriptions","organizations_url":"https://api.github.com/users/caolan/orgs","repos_url":"https://api.github.com/users/caolan/repos","events_url":"https://api.github.com/users/caolan/events{/privacy}","received_events_url":"https://api.github.com/users/caolan/received_events","type":"User","site_admin":false},"repo":{"id":698041,"name":"async","full_name":"caolan/async","owner":{"login":"caolan","id":5274,"avatar_url":"https://avatars.githubusercontent.com/u/5274?v=3","gravatar_id":"","url":"https://api.github.com/users/caolan","html_url":"https://github.com/caolan","followers_url":"https://api.github.com/users/caolan/followers","following_url":"https://api.github.com/users/caolan/following{/other_user}","gists_url":"https://api.github.com/users/caolan/gists{/gist_id}","starred_url":"https://api.github.com/users/caolan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caolan/subscriptions","organizations_url":"https://api.github.com/users/caolan/orgs","repos_url":"https://api.github.com/users/caolan/repos","events_url":"https://api.github.com/users/caolan/events{/privacy}","received_events_url":"https://api.github.com/users/caolan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/caolan/async","description":"Async utilities for node and the browser","fork":false,"url":"https://api.github.com/repos/caolan/async","forks_url":"https://api.github.com/repos/caolan/async/forks","keys_url":"https://api.github.com/repos/caolan/async/keys{/key_id}","collaborators_url":"https://api.github.com/repos/caolan/async/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/caolan/async/teams","hooks_url":"https://api.github.com/repos/caolan/async/hooks","issue_events_url":"https://api.github.com/repos/caolan/async/issues/events{/number}","events_url":"https://api.github.com/repos/caolan/async/events","assignees_url":"https://api.github.com/repos/caolan/async/assignees{/user}","branches_url":"https://api.github.com/repos/caolan/async/branches{/branch}","tags_url":"https://api.github.com/repos/caolan/async/tags","blobs_url":"https://api.github.com/repos/caolan/async/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/caolan/async/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/caolan/async/git/refs{/sha}","trees_url":"https://api.github.com/repos/caolan/async/git/trees{/sha}","statuses_url":"https://api.github.com/repos/caolan/async/statuses/{sha}","languages_url":"https://api.github.com/repos/caolan/async/languages","stargazers_url":"https://api.github.com/repos/caolan/async/stargazers","contributors_url":"https://api.github.com/repos/caolan/async/contributors","subscribers_url":"https://api.github.com/repos/caolan/async/subscribers","subscription_url":"https://api.github.com/repos/caolan/async/subscription","commits_url":"https://api.github.com/repos/caolan/async/commits{/sha}","git_commits_url":"https://api.github.com/repos/caolan/async/git/commits{/sha}","comments_url":"https://api.github.com/repos/caolan/async/comments{/number}","issue_comment_url":"https://api.github.com/repos/caolan/async/issues/comments{/number}","contents_url":"https://api.github.com/repos/caolan/async/contents/{+path}","compare_url":"https://api.github.com/repos/caolan/async/compare/{base}...{head}","merges_url":"https://api.github.com/repos/caolan/async/merges","archive_url":"https://api.github.com/repos/caolan/async/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/caolan/async/downloads","issues_url":"https://api.github.com/repos/caolan/async/issues{/number}","pulls_url":"https://api.github.com/repos/caolan/async/pulls{/number}","milestones_url":"https://api.github.com/repos/caolan/async/milestones{/number}","notifications_url":"https://api.github.com/repos/caolan/async/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/caolan/async/labels{/name}","releases_url":"https://api.github.com/repos/caolan/async/releases{/id}","deployments_url":"https://api.github.com/repos/caolan/async/deployments","created_at":"2010-06-01T21:01:30Z","updated_at":"2016-10-05T13:39:34Z","pushed_at":"2016-10-05T14:52:09Z","git_url":"git://github.com/caolan/async.git","ssh_url":"git@github.com:caolan/async.git","clone_url":"https://github.com/caolan/async.git","svn_url":"https://github.com/caolan/async","homepage":"http://caolan.github.io/async/","size":6747,"stargazers_count":19281,"watchers_count":19281,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1893,"mirror_url":null,"open_issues_count":23,"forks":1893,"open_issues":23,"watchers":19281,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/caolan/async/pulls/1297"},"html":{"href":"https://github.com/caolan/async/pull/1297"},"issue":{"href":"https://api.github.com/repos/caolan/async/issues/1297"},"comments":{"href":"https://api.github.com/repos/caolan/async/issues/1297/comments"},"review_comments":{"href":"https://api.github.com/repos/caolan/async/pulls/1297/comments"},"review_comment":{"href":"https://api.github.com/repos/caolan/async/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/caolan/async/pulls/1297/commits"},"statuses":{"href":"https://api.github.com/repos/caolan/async/statuses/8695676064402b5744af9597ffc889c9e0cd15b9"}}}}
{"actor":{"display_login":"megawac"}}