{"action":"created","comment":{"url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/pulls/comments/48045330","id":48045330,"diff_hunk":"@@ -90,16 +90,13 @@ public final class MutableProperty<Value>: MutablePropertyType {\n \tpublic var value: Value {\n \t\tget {\n \t\t\tlock.lock()\n-\t\t\tlet value = _value\n-\t\t\tlock.unlock()\n-\t\t\treturn value\n+\t\t\tdefer { lock.unlock() }\n+\n+\t\t\treturn _value\n \t\t}\n \n \t\tset {\n-\t\t\tlock.lock()\n-\t\t\t_value = newValue\n-\t\t\tobserver.sendNext(newValue)\n-\t\t\tlock.unlock()\n+\t\t\tmodify { _ in newValue }","path":"ReactiveCocoa/Swift/Property.swift","position":17,"original_position":17,"commit_id":"f5481b15ad6b5163594710b172162584c563e130","original_commit_id":"0fbefb320ce4db7bf91ee9f261812005a409a763","user":{"login":"NachoSoto","id":685609,"avatar_url":"https://avatars.githubusercontent.com/u/685609?v=3","gravatar_id":"","url":"https://api.github.com/users/NachoSoto","html_url":"https://github.com/NachoSoto","followers_url":"https://api.github.com/users/NachoSoto/followers","following_url":"https://api.github.com/users/NachoSoto/following{/other_user}","gists_url":"https://api.github.com/users/NachoSoto/gists{/gist_id}","starred_url":"https://api.github.com/users/NachoSoto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NachoSoto/subscriptions","organizations_url":"https://api.github.com/users/NachoSoto/orgs","repos_url":"https://api.github.com/users/NachoSoto/repos","events_url":"https://api.github.com/users/NachoSoto/events{/privacy}","received_events_url":"https://api.github.com/users/NachoSoto/received_events","type":"User","site_admin":false},"body":"Ooooh my bad, I missed that detail.","created_at":"2015-12-18T16:55:00Z","updated_at":"2015-12-18T16:55:00Z","html_url":"https://github.com/ReactiveCocoa/ReactiveCocoa/pull/2617#discussion_r48045330","pull_request_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/pulls/2617","_links":{"self":{"href":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/pulls/comments/48045330"},"html":{"href":"https://github.com/ReactiveCocoa/ReactiveCocoa/pull/2617#discussion_r48045330"},"pull_request":{"href":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/pulls/2617"}}},"pull_request":{"url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/pulls/2617","id":53681367,"html_url":"https://github.com/ReactiveCocoa/ReactiveCocoa/pull/2617","diff_url":"https://github.com/ReactiveCocoa/ReactiveCocoa/pull/2617.diff","patch_url":"https://github.com/ReactiveCocoa/ReactiveCocoa/pull/2617.patch","issue_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/issues/2617","number":2617,"state":"open","locked":false,"title":"Introduce Atomic's `modify`, `swap` and `withValue` to MutableProperty.","user":{"login":"andersio","id":11806295,"avatar_url":"https://avatars.githubusercontent.com/u/11806295?v=3","gravatar_id":"","url":"https://api.github.com/users/andersio","html_url":"https://github.com/andersio","followers_url":"https://api.github.com/users/andersio/followers","following_url":"https://api.github.com/users/andersio/following{/other_user}","gists_url":"https://api.github.com/users/andersio/gists{/gist_id}","starred_url":"https://api.github.com/users/andersio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andersio/subscriptions","organizations_url":"https://api.github.com/users/andersio/orgs","repos_url":"https://api.github.com/users/andersio/repos","events_url":"https://api.github.com/users/andersio/events{/privacy}","received_events_url":"https://api.github.com/users/andersio/received_events","type":"User","site_admin":false},"body":"Related Issue: #2615 \r\n\r\nIn a nutshell, this PR:\r\n\r\n1. introduced `modify(action:)`, `swap(newValue:)` and `withValue(action:)` to `MutableProperty`;\r\n2. new test cases for these new methods;\r\n3. a stylish refactor of `value.getter`;\r\n4. makes `value.setter` use the new `modify(action:)` method; and\r\n5. removed an invalid test case from AtomicSpec (the related overload was removed in https://github.com/ReactiveCocoa/ReactiveCocoa/commit/d83b219cd61d27b9a0e8402ac864de42e85bf657 as mentioned by @ikesyo).","created_at":"2015-12-15T09:55:49Z","updated_at":"2015-12-18T16:55:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"711ffba9a5aaa7c78dbb5b69056e9c62930e00dc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/pulls/2617/commits","review_comments_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/pulls/2617/comments","review_comment_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/issues/2617/comments","statuses_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/statuses/f5481b15ad6b5163594710b172162584c563e130","head":{"label":"andersio:2615-modify","ref":"2615-modify","sha":"f5481b15ad6b5163594710b172162584c563e130","user":{"login":"andersio","id":11806295,"avatar_url":"https://avatars.githubusercontent.com/u/11806295?v=3","gravatar_id":"","url":"https://api.github.com/users/andersio","html_url":"https://github.com/andersio","followers_url":"https://api.github.com/users/andersio/followers","following_url":"https://api.github.com/users/andersio/following{/other_user}","gists_url":"https://api.github.com/users/andersio/gists{/gist_id}","starred_url":"https://api.github.com/users/andersio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andersio/subscriptions","organizations_url":"https://api.github.com/users/andersio/orgs","repos_url":"https://api.github.com/users/andersio/repos","events_url":"https://api.github.com/users/andersio/events{/privacy}","received_events_url":"https://api.github.com/users/andersio/received_events","type":"User","site_admin":false},"repo":{"id":47269531,"name":"ReactiveCocoa","full_name":"andersio/ReactiveCocoa","owner":{"login":"andersio","id":11806295,"avatar_url":"https://avatars.githubusercontent.com/u/11806295?v=3","gravatar_id":"","url":"https://api.github.com/users/andersio","html_url":"https://github.com/andersio","followers_url":"https://api.github.com/users/andersio/followers","following_url":"https://api.github.com/users/andersio/following{/other_user}","gists_url":"https://api.github.com/users/andersio/gists{/gist_id}","starred_url":"https://api.github.com/users/andersio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andersio/subscriptions","organizations_url":"https://api.github.com/users/andersio/orgs","repos_url":"https://api.github.com/users/andersio/repos","events_url":"https://api.github.com/users/andersio/events{/privacy}","received_events_url":"https://api.github.com/users/andersio/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andersio/ReactiveCocoa","description":"Streams of values over time","fork":true,"url":"https://api.github.com/repos/andersio/ReactiveCocoa","forks_url":"https://api.github.com/repos/andersio/ReactiveCocoa/forks","keys_url":"https://api.github.com/repos/andersio/ReactiveCocoa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andersio/ReactiveCocoa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andersio/ReactiveCocoa/teams","hooks_url":"https://api.github.com/repos/andersio/ReactiveCocoa/hooks","issue_events_url":"https://api.github.com/repos/andersio/ReactiveCocoa/issues/events{/number}","events_url":"https://api.github.com/repos/andersio/ReactiveCocoa/events","assignees_url":"https://api.github.com/repos/andersio/ReactiveCocoa/assignees{/user}","branches_url":"https://api.github.com/repos/andersio/ReactiveCocoa/branches{/branch}","tags_url":"https://api.github.com/repos/andersio/ReactiveCocoa/tags","blobs_url":"https://api.github.com/repos/andersio/ReactiveCocoa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andersio/ReactiveCocoa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andersio/ReactiveCocoa/git/refs{/sha}","trees_url":"https://api.github.com/repos/andersio/ReactiveCocoa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andersio/ReactiveCocoa/statuses/{sha}","languages_url":"https://api.github.com/repos/andersio/ReactiveCocoa/languages","stargazers_url":"https://api.github.com/repos/andersio/ReactiveCocoa/stargazers","contributors_url":"https://api.github.com/repos/andersio/ReactiveCocoa/contributors","subscribers_url":"https://api.github.com/repos/andersio/ReactiveCocoa/subscribers","subscription_url":"https://api.github.com/repos/andersio/ReactiveCocoa/subscription","commits_url":"https://api.github.com/repos/andersio/ReactiveCocoa/commits{/sha}","git_commits_url":"https://api.github.com/repos/andersio/ReactiveCocoa/git/commits{/sha}","comments_url":"https://api.github.com/repos/andersio/ReactiveCocoa/comments{/number}","issue_comment_url":"https://api.github.com/repos/andersio/ReactiveCocoa/issues/comments{/number}","contents_url":"https://api.github.com/repos/andersio/ReactiveCocoa/contents/{+path}","compare_url":"https://api.github.com/repos/andersio/ReactiveCocoa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andersio/ReactiveCocoa/merges","archive_url":"https://api.github.com/repos/andersio/ReactiveCocoa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andersio/ReactiveCocoa/downloads","issues_url":"https://api.github.com/repos/andersio/ReactiveCocoa/issues{/number}","pulls_url":"https://api.github.com/repos/andersio/ReactiveCocoa/pulls{/number}","milestones_url":"https://api.github.com/repos/andersio/ReactiveCocoa/milestones{/number}","notifications_url":"https://api.github.com/repos/andersio/ReactiveCocoa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andersio/ReactiveCocoa/labels{/name}","releases_url":"https://api.github.com/repos/andersio/ReactiveCocoa/releases{/id}","created_at":"2015-12-02T15:21:14Z","updated_at":"2015-12-02T15:21:18Z","pushed_at":"2015-12-18T08:19:07Z","git_url":"git://github.com/andersio/ReactiveCocoa.git","ssh_url":"git@github.com:andersio/ReactiveCocoa.git","clone_url":"https://github.com/andersio/ReactiveCocoa.git","svn_url":"https://github.com/andersio/ReactiveCocoa","homepage":"","size":15147,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"ReactiveCocoa:master","ref":"master","sha":"2a708b77833be3846d9629aa38d7a0723ed4a70b","user":{"login":"ReactiveCocoa","id":3422977,"avatar_url":"https://avatars.githubusercontent.com/u/3422977?v=3","gravatar_id":"","url":"https://api.github.com/users/ReactiveCocoa","html_url":"https://github.com/ReactiveCocoa","followers_url":"https://api.github.com/users/ReactiveCocoa/followers","following_url":"https://api.github.com/users/ReactiveCocoa/following{/other_user}","gists_url":"https://api.github.com/users/ReactiveCocoa/gists{/gist_id}","starred_url":"https://api.github.com/users/ReactiveCocoa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ReactiveCocoa/subscriptions","organizations_url":"https://api.github.com/users/ReactiveCocoa/orgs","repos_url":"https://api.github.com/users/ReactiveCocoa/repos","events_url":"https://api.github.com/users/ReactiveCocoa/events{/privacy}","received_events_url":"https://api.github.com/users/ReactiveCocoa/received_events","type":"Organization","site_admin":false},"repo":{"id":3606624,"name":"ReactiveCocoa","full_name":"ReactiveCocoa/ReactiveCocoa","owner":{"login":"ReactiveCocoa","id":3422977,"avatar_url":"https://avatars.githubusercontent.com/u/3422977?v=3","gravatar_id":"","url":"https://api.github.com/users/ReactiveCocoa","html_url":"https://github.com/ReactiveCocoa","followers_url":"https://api.github.com/users/ReactiveCocoa/followers","following_url":"https://api.github.com/users/ReactiveCocoa/following{/other_user}","gists_url":"https://api.github.com/users/ReactiveCocoa/gists{/gist_id}","starred_url":"https://api.github.com/users/ReactiveCocoa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ReactiveCocoa/subscriptions","organizations_url":"https://api.github.com/users/ReactiveCocoa/orgs","repos_url":"https://api.github.com/users/ReactiveCocoa/repos","events_url":"https://api.github.com/users/ReactiveCocoa/events{/privacy}","received_events_url":"https://api.github.com/users/ReactiveCocoa/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ReactiveCocoa/ReactiveCocoa","description":"Streams of values over time","fork":false,"url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa","forks_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/forks","keys_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/teams","hooks_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/hooks","issue_events_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/issues/events{/number}","events_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/events","assignees_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/assignees{/user}","branches_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/branches{/branch}","tags_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/tags","blobs_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/git/refs{/sha}","trees_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/statuses/{sha}","languages_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/languages","stargazers_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/stargazers","contributors_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/contributors","subscribers_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/subscribers","subscription_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/subscription","commits_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/commits{/sha}","git_commits_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/git/commits{/sha}","comments_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/comments{/number}","issue_comment_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/issues/comments{/number}","contents_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/contents/{+path}","compare_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/merges","archive_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/downloads","issues_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/issues{/number}","pulls_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/pulls{/number}","milestones_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/milestones{/number}","notifications_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/labels{/name}","releases_url":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/releases{/id}","created_at":"2012-03-02T22:11:24Z","updated_at":"2015-12-18T13:35:12Z","pushed_at":"2015-12-18T08:19:08Z","git_url":"git://github.com/ReactiveCocoa/ReactiveCocoa.git","ssh_url":"git@github.com:ReactiveCocoa/ReactiveCocoa.git","clone_url":"https://github.com/ReactiveCocoa/ReactiveCocoa.git","svn_url":"https://github.com/ReactiveCocoa/ReactiveCocoa","homepage":"","size":23237,"stargazers_count":11771,"watchers_count":11771,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2095,"mirror_url":null,"open_issues_count":212,"forks":2095,"open_issues":212,"watchers":11771,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/pulls/2617"},"html":{"href":"https://github.com/ReactiveCocoa/ReactiveCocoa/pull/2617"},"issue":{"href":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/issues/2617"},"comments":{"href":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/issues/2617/comments"},"review_comments":{"href":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/pulls/2617/comments"},"review_comment":{"href":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/pulls/2617/commits"},"statuses":{"href":"https://api.github.com/repos/ReactiveCocoa/ReactiveCocoa/statuses/f5481b15ad6b5163594710b172162584c563e130"}}}}