{"action":"closed","number":303,"pull_request":{"url":"https://api.github.com/repos/facebook/immutable-js/pulls/303","id":28415906,"html_url":"https://github.com/facebook/immutable-js/pull/303","diff_url":"https://github.com/facebook/immutable-js/pull/303.diff","patch_url":"https://github.com/facebook/immutable-js/pull/303.patch","issue_url":"https://api.github.com/repos/facebook/immutable-js/issues/303","number":303,"state":"closed","locked":false,"title":"Add specialized Map#map to keep ref. equality","user":{"login":"jeanlauliac","id":1733570,"avatar_url":"https://avatars.githubusercontent.com/u/1733570?v=3","gravatar_id":"","url":"https://api.github.com/users/jeanlauliac","html_url":"https://github.com/jeanlauliac","followers_url":"https://api.github.com/users/jeanlauliac/followers","following_url":"https://api.github.com/users/jeanlauliac/following{/other_user}","gists_url":"https://api.github.com/users/jeanlauliac/gists{/gist_id}","starred_url":"https://api.github.com/users/jeanlauliac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeanlauliac/subscriptions","organizations_url":"https://api.github.com/users/jeanlauliac/orgs","repos_url":"https://api.github.com/users/jeanlauliac/repos","events_url":"https://api.github.com/users/jeanlauliac/events{/privacy}","received_events_url":"https://api.github.com/users/jeanlauliac/received_events","type":"User","site_admin":false},"body":"NOTE: this changeset contains an unfortunate amount of unrelated changes to the built files. That means a previous commit was done without running `grunt`.\r\n\r\nNOTE: the positioning of the function in the file is to be discussed, I'm not too sure if we want to create a new pragma section or not. The documentation will probably need a little update as well (https://facebook.github.io/immutable-js/docs/#/Map/map)\r\n\r\n---\r\n\r\nThe point is to keep the referential equality when no value changed. This let\r\none call `Map#map` without afterthoughts about optimization. For example, let's\r\nimagine that we trigger an interface render when a `Map` changed; we want to\r\navoid the cost of re-rendering when no value changed. Without referential\r\nequality, we'd have a write some kind of custom algorithm to compare the values\r\nreturned by `mapper`.\r\n\r\nThe performance of this function is no worse, as the generalized\r\n`IterableImpl#map` always reifies the mapped sequence anyway. On the other hand,\r\nthe fact we're applying modifications to the existing `Map` mean we're\r\nbenefiting from the internal structure optimizations.\r\n\r\nAs a side note, I find it interesting to see how a custom `map` function looks\r\nsignificantly simpler than going through the generalized operation on `Seq`.\r\nGranted, we lose the unification of sequence transformation algorithms, but\r\nthe original problem this changeset addresses proves it's hardly possible to\r\ntotally abstract a `Map` as a `Seq`: a `Seq` loses the concept of concreteness.\r\n\r\nA similar fix can be used for `filter`, at least.\r\n\r\nSee #285.","created_at":"2015-01-31T14:59:40Z","updated_at":"2015-08-05T16:12:02Z","closed_at":"2015-08-05T16:12:02Z","merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/facebook/immutable-js/pulls/303/commits","review_comments_url":"https://api.github.com/repos/facebook/immutable-js/pulls/303/comments","review_comment_url":"https://api.github.com/repos/facebook/immutable-js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebook/immutable-js/issues/303/comments","statuses_url":"https://api.github.com/repos/facebook/immutable-js/statuses/468a7dd0d483cab8a3c04c65f1822ad8d3189f25","head":{"label":"jeanlauliac:map-ref-equality","ref":"map-ref-equality","sha":"468a7dd0d483cab8a3c04c65f1822ad8d3189f25","user":{"login":"jeanlauliac","id":1733570,"avatar_url":"https://avatars.githubusercontent.com/u/1733570?v=3","gravatar_id":"","url":"https://api.github.com/users/jeanlauliac","html_url":"https://github.com/jeanlauliac","followers_url":"https://api.github.com/users/jeanlauliac/followers","following_url":"https://api.github.com/users/jeanlauliac/following{/other_user}","gists_url":"https://api.github.com/users/jeanlauliac/gists{/gist_id}","starred_url":"https://api.github.com/users/jeanlauliac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeanlauliac/subscriptions","organizations_url":"https://api.github.com/users/jeanlauliac/orgs","repos_url":"https://api.github.com/users/jeanlauliac/repos","events_url":"https://api.github.com/users/jeanlauliac/events{/privacy}","received_events_url":"https://api.github.com/users/jeanlauliac/received_events","type":"User","site_admin":false},"repo":{"id":30091820,"name":"immutable-js","full_name":"jeanlauliac/immutable-js","owner":{"login":"jeanlauliac","id":1733570,"avatar_url":"https://avatars.githubusercontent.com/u/1733570?v=3","gravatar_id":"","url":"https://api.github.com/users/jeanlauliac","html_url":"https://github.com/jeanlauliac","followers_url":"https://api.github.com/users/jeanlauliac/followers","following_url":"https://api.github.com/users/jeanlauliac/following{/other_user}","gists_url":"https://api.github.com/users/jeanlauliac/gists{/gist_id}","starred_url":"https://api.github.com/users/jeanlauliac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeanlauliac/subscriptions","organizations_url":"https://api.github.com/users/jeanlauliac/orgs","repos_url":"https://api.github.com/users/jeanlauliac/repos","events_url":"https://api.github.com/users/jeanlauliac/events{/privacy}","received_events_url":"https://api.github.com/users/jeanlauliac/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jeanlauliac/immutable-js","description":"Immutable persistent data collections for Javascript which increase efficiency and simplicity.","fork":true,"url":"https://api.github.com/repos/jeanlauliac/immutable-js","forks_url":"https://api.github.com/repos/jeanlauliac/immutable-js/forks","keys_url":"https://api.github.com/repos/jeanlauliac/immutable-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jeanlauliac/immutable-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jeanlauliac/immutable-js/teams","hooks_url":"https://api.github.com/repos/jeanlauliac/immutable-js/hooks","issue_events_url":"https://api.github.com/repos/jeanlauliac/immutable-js/issues/events{/number}","events_url":"https://api.github.com/repos/jeanlauliac/immutable-js/events","assignees_url":"https://api.github.com/repos/jeanlauliac/immutable-js/assignees{/user}","branches_url":"https://api.github.com/repos/jeanlauliac/immutable-js/branches{/branch}","tags_url":"https://api.github.com/repos/jeanlauliac/immutable-js/tags","blobs_url":"https://api.github.com/repos/jeanlauliac/immutable-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jeanlauliac/immutable-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jeanlauliac/immutable-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/jeanlauliac/immutable-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jeanlauliac/immutable-js/statuses/{sha}","languages_url":"https://api.github.com/repos/jeanlauliac/immutable-js/languages","stargazers_url":"https://api.github.com/repos/jeanlauliac/immutable-js/stargazers","contributors_url":"https://api.github.com/repos/jeanlauliac/immutable-js/contributors","subscribers_url":"https://api.github.com/repos/jeanlauliac/immutable-js/subscribers","subscription_url":"https://api.github.com/repos/jeanlauliac/immutable-js/subscription","commits_url":"https://api.github.com/repos/jeanlauliac/immutable-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/jeanlauliac/immutable-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/jeanlauliac/immutable-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/jeanlauliac/immutable-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/jeanlauliac/immutable-js/contents/{+path}","compare_url":"https://api.github.com/repos/jeanlauliac/immutable-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jeanlauliac/immutable-js/merges","archive_url":"https://api.github.com/repos/jeanlauliac/immutable-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jeanlauliac/immutable-js/downloads","issues_url":"https://api.github.com/repos/jeanlauliac/immutable-js/issues{/number}","pulls_url":"https://api.github.com/repos/jeanlauliac/immutable-js/pulls{/number}","milestones_url":"https://api.github.com/repos/jeanlauliac/immutable-js/milestones{/number}","notifications_url":"https://api.github.com/repos/jeanlauliac/immutable-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jeanlauliac/immutable-js/labels{/name}","releases_url":"https://api.github.com/repos/jeanlauliac/immutable-js/releases{/id}","created_at":"2015-01-30T21:36:44Z","updated_at":"2015-01-30T21:36:44Z","pushed_at":"2015-01-31T14:55:51Z","git_url":"git://github.com/jeanlauliac/immutable-js.git","ssh_url":"git@github.com:jeanlauliac/immutable-js.git","clone_url":"https://github.com/jeanlauliac/immutable-js.git","svn_url":"https://github.com/jeanlauliac/immutable-js","homepage":"http://facebook.github.io/immutable-js/","size":19584,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"facebook:master","ref":"master","sha":"691ad67eff57d2addd739848c195140e6f488f94","user":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"repo":{"id":21413198,"name":"immutable-js","full_name":"facebook/immutable-js","owner":{"login":"facebook","id":69631,"avatar_url":"https://avatars.githubusercontent.com/u/69631?v=3","gravatar_id":"","url":"https://api.github.com/users/facebook","html_url":"https://github.com/facebook","followers_url":"https://api.github.com/users/facebook/followers","following_url":"https://api.github.com/users/facebook/following{/other_user}","gists_url":"https://api.github.com/users/facebook/gists{/gist_id}","starred_url":"https://api.github.com/users/facebook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebook/subscriptions","organizations_url":"https://api.github.com/users/facebook/orgs","repos_url":"https://api.github.com/users/facebook/repos","events_url":"https://api.github.com/users/facebook/events{/privacy}","received_events_url":"https://api.github.com/users/facebook/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/facebook/immutable-js","description":"Immutable persistent data collections for Javascript which increase efficiency and simplicity.","fork":false,"url":"https://api.github.com/repos/facebook/immutable-js","forks_url":"https://api.github.com/repos/facebook/immutable-js/forks","keys_url":"https://api.github.com/repos/facebook/immutable-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebook/immutable-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebook/immutable-js/teams","hooks_url":"https://api.github.com/repos/facebook/immutable-js/hooks","issue_events_url":"https://api.github.com/repos/facebook/immutable-js/issues/events{/number}","events_url":"https://api.github.com/repos/facebook/immutable-js/events","assignees_url":"https://api.github.com/repos/facebook/immutable-js/assignees{/user}","branches_url":"https://api.github.com/repos/facebook/immutable-js/branches{/branch}","tags_url":"https://api.github.com/repos/facebook/immutable-js/tags","blobs_url":"https://api.github.com/repos/facebook/immutable-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebook/immutable-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebook/immutable-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebook/immutable-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebook/immutable-js/statuses/{sha}","languages_url":"https://api.github.com/repos/facebook/immutable-js/languages","stargazers_url":"https://api.github.com/repos/facebook/immutable-js/stargazers","contributors_url":"https://api.github.com/repos/facebook/immutable-js/contributors","subscribers_url":"https://api.github.com/repos/facebook/immutable-js/subscribers","subscription_url":"https://api.github.com/repos/facebook/immutable-js/subscription","commits_url":"https://api.github.com/repos/facebook/immutable-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebook/immutable-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebook/immutable-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebook/immutable-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebook/immutable-js/contents/{+path}","compare_url":"https://api.github.com/repos/facebook/immutable-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebook/immutable-js/merges","archive_url":"https://api.github.com/repos/facebook/immutable-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebook/immutable-js/downloads","issues_url":"https://api.github.com/repos/facebook/immutable-js/issues{/number}","pulls_url":"https://api.github.com/repos/facebook/immutable-js/pulls{/number}","milestones_url":"https://api.github.com/repos/facebook/immutable-js/milestones{/number}","notifications_url":"https://api.github.com/repos/facebook/immutable-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebook/immutable-js/labels{/name}","releases_url":"https://api.github.com/repos/facebook/immutable-js/releases{/id}","created_at":"2014-07-02T06:02:29Z","updated_at":"2015-08-05T13:50:20Z","pushed_at":"2015-07-30T20:42:15Z","git_url":"git://github.com/facebook/immutable-js.git","ssh_url":"git@github.com:facebook/immutable-js.git","clone_url":"https://github.com/facebook/immutable-js.git","svn_url":"https://github.com/facebook/immutable-js","homepage":"http://facebook.github.io/immutable-js/","size":25103,"stargazers_count":7757,"watchers_count":7757,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":373,"mirror_url":null,"open_issues_count":147,"forks":373,"open_issues":147,"watchers":7757,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebook/immutable-js/pulls/303"},"html":{"href":"https://github.com/facebook/immutable-js/pull/303"},"issue":{"href":"https://api.github.com/repos/facebook/immutable-js/issues/303"},"comments":{"href":"https://api.github.com/repos/facebook/immutable-js/issues/303/comments"},"review_comments":{"href":"https://api.github.com/repos/facebook/immutable-js/pulls/303/comments"},"review_comment":{"href":"https://api.github.com/repos/facebook/immutable-js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebook/immutable-js/pulls/303/commits"},"statuses":{"href":"https://api.github.com/repos/facebook/immutable-js/statuses/468a7dd0d483cab8a3c04c65f1822ad8d3189f25"}},"merged":false,"mergeable":false,"mergeable_state":"dirty","merged_by":null,"comments":2,"review_comments":0,"commits":1,"additions":136,"deletions":114,"changed_files":5}}