{"action":"created","comment":{"url":"https://api.github.com/repos/ReactiveX/RxJava/pulls/comments/44215383","id":44215383,"diff_hunk":"@@ -191,11 +191,7 @@ public Boolean call(String t1) {\n             @Override\n             public Boolean call(String t1) {\n                 list.add(t1);\n-                if (i++ == 2) {\n-                    return false;\n-                } else {\n-                    return true;\n-                }\n+                return i++ != 2;","path":"src/test/java/rx/internal/util/IndexedRingBufferTest.java","position":9,"original_position":9,"commit_id":"d7183a898d6fa5360b76165558baef3276722119","original_commit_id":"d7183a898d6fa5360b76165558baef3276722119","user":{"login":"artem-zinnatullin","id":967132,"avatar_url":"https://avatars.githubusercontent.com/u/967132?v=3","gravatar_id":"","url":"https://api.github.com/users/artem-zinnatullin","html_url":"https://github.com/artem-zinnatullin","followers_url":"https://api.github.com/users/artem-zinnatullin/followers","following_url":"https://api.github.com/users/artem-zinnatullin/following{/other_user}","gists_url":"https://api.github.com/users/artem-zinnatullin/gists{/gist_id}","starred_url":"https://api.github.com/users/artem-zinnatullin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artem-zinnatullin/subscriptions","organizations_url":"https://api.github.com/users/artem-zinnatullin/orgs","repos_url":"https://api.github.com/users/artem-zinnatullin/repos","events_url":"https://api.github.com/users/artem-zinnatullin/events{/privacy}","received_events_url":"https://api.github.com/users/artem-zinnatullin/received_events","type":"User","site_admin":false},"body":">I could take that \"i++\" one separate line higher.\r\n\r\nThat's why I don't like such code, it's non-obvious (but short), in fact, \"post `++`\" will be applied after the condition check, so correct transformation would be:\r\n\r\n```java\r\nfinal boolean result = i != 2;\r\ni++;\r\nreturn result;\r\n``` \r\n\r\nAt least, we don't have undefined behavior here, so, you can leave it as is, but personally, I'd rewrite it. ","created_at":"2015-11-07T18:35:23Z","updated_at":"2015-11-07T18:35:23Z","html_url":"https://github.com/ReactiveX/RxJava/pull/3500#discussion_r44215383","pull_request_url":"https://api.github.com/repos/ReactiveX/RxJava/pulls/3500","_links":{"self":{"href":"https://api.github.com/repos/ReactiveX/RxJava/pulls/comments/44215383"},"html":{"href":"https://github.com/ReactiveX/RxJava/pull/3500#discussion_r44215383"},"pull_request":{"href":"https://api.github.com/repos/ReactiveX/RxJava/pulls/3500"}}},"pull_request":{"url":"https://api.github.com/repos/ReactiveX/RxJava/pulls/3500","id":50040199,"html_url":"https://github.com/ReactiveX/RxJava/pull/3500","diff_url":"https://github.com/ReactiveX/RxJava/pull/3500.diff","patch_url":"https://github.com/ReactiveX/RxJava/pull/3500.patch","issue_url":"https://api.github.com/repos/ReactiveX/RxJava/issues/3500","number":3500,"state":"open","locked":false,"title":"Some code clean ups.","user":{"login":"dromato","id":7831373,"avatar_url":"https://avatars.githubusercontent.com/u/7831373?v=3","gravatar_id":"","url":"https://api.github.com/users/dromato","html_url":"https://github.com/dromato","followers_url":"https://api.github.com/users/dromato/followers","following_url":"https://api.github.com/users/dromato/following{/other_user}","gists_url":"https://api.github.com/users/dromato/gists{/gist_id}","starred_url":"https://api.github.com/users/dromato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dromato/subscriptions","organizations_url":"https://api.github.com/users/dromato/orgs","repos_url":"https://api.github.com/users/dromato/repos","events_url":"https://api.github.com/users/dromato/events{/privacy}","received_events_url":"https://api.github.com/users/dromato/received_events","type":"User","site_admin":false},"body":"Nothing that could change logic or application flow, just minor refactors to be consistent with good practices and clean code.\r\nTo sum up changes:\r\n- Simplified some conditions\r\n- Changed small l to L in long number, as l tends to look like 1 and might confuse\r\n- Removed \"return\" statements where those are not necessary (last instruction in function)\r\n- Inlined returns where there were no need for creating new variable (easier to read)\r\n- Deleted unnecessary colons","created_at":"2015-11-07T17:10:54Z","updated_at":"2015-11-07T18:35:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d5286f572532a102a4c2bbd53d9096d02cc26b84","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ReactiveX/RxJava/pulls/3500/commits","review_comments_url":"https://api.github.com/repos/ReactiveX/RxJava/pulls/3500/comments","review_comment_url":"https://api.github.com/repos/ReactiveX/RxJava/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ReactiveX/RxJava/issues/3500/comments","statuses_url":"https://api.github.com/repos/ReactiveX/RxJava/statuses/d7183a898d6fa5360b76165558baef3276722119","head":{"label":"dromato:1.x","ref":"1.x","sha":"d7183a898d6fa5360b76165558baef3276722119","user":{"login":"dromato","id":7831373,"avatar_url":"https://avatars.githubusercontent.com/u/7831373?v=3","gravatar_id":"","url":"https://api.github.com/users/dromato","html_url":"https://github.com/dromato","followers_url":"https://api.github.com/users/dromato/followers","following_url":"https://api.github.com/users/dromato/following{/other_user}","gists_url":"https://api.github.com/users/dromato/gists{/gist_id}","starred_url":"https://api.github.com/users/dromato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dromato/subscriptions","organizations_url":"https://api.github.com/users/dromato/orgs","repos_url":"https://api.github.com/users/dromato/repos","events_url":"https://api.github.com/users/dromato/events{/privacy}","received_events_url":"https://api.github.com/users/dromato/received_events","type":"User","site_admin":false},"repo":{"id":45738513,"name":"RxJava","full_name":"dromato/RxJava","owner":{"login":"dromato","id":7831373,"avatar_url":"https://avatars.githubusercontent.com/u/7831373?v=3","gravatar_id":"","url":"https://api.github.com/users/dromato","html_url":"https://github.com/dromato","followers_url":"https://api.github.com/users/dromato/followers","following_url":"https://api.github.com/users/dromato/following{/other_user}","gists_url":"https://api.github.com/users/dromato/gists{/gist_id}","starred_url":"https://api.github.com/users/dromato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dromato/subscriptions","organizations_url":"https://api.github.com/users/dromato/orgs","repos_url":"https://api.github.com/users/dromato/repos","events_url":"https://api.github.com/users/dromato/events{/privacy}","received_events_url":"https://api.github.com/users/dromato/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dromato/RxJava","description":"RxJava – Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM.","fork":true,"url":"https://api.github.com/repos/dromato/RxJava","forks_url":"https://api.github.com/repos/dromato/RxJava/forks","keys_url":"https://api.github.com/repos/dromato/RxJava/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dromato/RxJava/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dromato/RxJava/teams","hooks_url":"https://api.github.com/repos/dromato/RxJava/hooks","issue_events_url":"https://api.github.com/repos/dromato/RxJava/issues/events{/number}","events_url":"https://api.github.com/repos/dromato/RxJava/events","assignees_url":"https://api.github.com/repos/dromato/RxJava/assignees{/user}","branches_url":"https://api.github.com/repos/dromato/RxJava/branches{/branch}","tags_url":"https://api.github.com/repos/dromato/RxJava/tags","blobs_url":"https://api.github.com/repos/dromato/RxJava/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dromato/RxJava/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dromato/RxJava/git/refs{/sha}","trees_url":"https://api.github.com/repos/dromato/RxJava/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dromato/RxJava/statuses/{sha}","languages_url":"https://api.github.com/repos/dromato/RxJava/languages","stargazers_url":"https://api.github.com/repos/dromato/RxJava/stargazers","contributors_url":"https://api.github.com/repos/dromato/RxJava/contributors","subscribers_url":"https://api.github.com/repos/dromato/RxJava/subscribers","subscription_url":"https://api.github.com/repos/dromato/RxJava/subscription","commits_url":"https://api.github.com/repos/dromato/RxJava/commits{/sha}","git_commits_url":"https://api.github.com/repos/dromato/RxJava/git/commits{/sha}","comments_url":"https://api.github.com/repos/dromato/RxJava/comments{/number}","issue_comment_url":"https://api.github.com/repos/dromato/RxJava/issues/comments{/number}","contents_url":"https://api.github.com/repos/dromato/RxJava/contents/{+path}","compare_url":"https://api.github.com/repos/dromato/RxJava/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dromato/RxJava/merges","archive_url":"https://api.github.com/repos/dromato/RxJava/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dromato/RxJava/downloads","issues_url":"https://api.github.com/repos/dromato/RxJava/issues{/number}","pulls_url":"https://api.github.com/repos/dromato/RxJava/pulls{/number}","milestones_url":"https://api.github.com/repos/dromato/RxJava/milestones{/number}","notifications_url":"https://api.github.com/repos/dromato/RxJava/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dromato/RxJava/labels{/name}","releases_url":"https://api.github.com/repos/dromato/RxJava/releases{/id}","created_at":"2015-11-07T13:56:36Z","updated_at":"2015-11-07T13:56:41Z","pushed_at":"2015-11-07T17:51:39Z","git_url":"git://github.com/dromato/RxJava.git","ssh_url":"git@github.com:dromato/RxJava.git","clone_url":"https://github.com/dromato/RxJava.git","svn_url":"https://github.com/dromato/RxJava","homepage":"","size":472217,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"1.x"}},"base":{"label":"ReactiveX:1.x","ref":"1.x","sha":"e802bb72024d86b7474b74a5b11bbf05654e852b","user":{"login":"ReactiveX","id":6407041,"avatar_url":"https://avatars.githubusercontent.com/u/6407041?v=3","gravatar_id":"","url":"https://api.github.com/users/ReactiveX","html_url":"https://github.com/ReactiveX","followers_url":"https://api.github.com/users/ReactiveX/followers","following_url":"https://api.github.com/users/ReactiveX/following{/other_user}","gists_url":"https://api.github.com/users/ReactiveX/gists{/gist_id}","starred_url":"https://api.github.com/users/ReactiveX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ReactiveX/subscriptions","organizations_url":"https://api.github.com/users/ReactiveX/orgs","repos_url":"https://api.github.com/users/ReactiveX/repos","events_url":"https://api.github.com/users/ReactiveX/events{/privacy}","received_events_url":"https://api.github.com/users/ReactiveX/received_events","type":"Organization","site_admin":false},"repo":{"id":7508411,"name":"RxJava","full_name":"ReactiveX/RxJava","owner":{"login":"ReactiveX","id":6407041,"avatar_url":"https://avatars.githubusercontent.com/u/6407041?v=3","gravatar_id":"","url":"https://api.github.com/users/ReactiveX","html_url":"https://github.com/ReactiveX","followers_url":"https://api.github.com/users/ReactiveX/followers","following_url":"https://api.github.com/users/ReactiveX/following{/other_user}","gists_url":"https://api.github.com/users/ReactiveX/gists{/gist_id}","starred_url":"https://api.github.com/users/ReactiveX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ReactiveX/subscriptions","organizations_url":"https://api.github.com/users/ReactiveX/orgs","repos_url":"https://api.github.com/users/ReactiveX/repos","events_url":"https://api.github.com/users/ReactiveX/events{/privacy}","received_events_url":"https://api.github.com/users/ReactiveX/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ReactiveX/RxJava","description":"RxJava – Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM.","fork":false,"url":"https://api.github.com/repos/ReactiveX/RxJava","forks_url":"https://api.github.com/repos/ReactiveX/RxJava/forks","keys_url":"https://api.github.com/repos/ReactiveX/RxJava/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ReactiveX/RxJava/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ReactiveX/RxJava/teams","hooks_url":"https://api.github.com/repos/ReactiveX/RxJava/hooks","issue_events_url":"https://api.github.com/repos/ReactiveX/RxJava/issues/events{/number}","events_url":"https://api.github.com/repos/ReactiveX/RxJava/events","assignees_url":"https://api.github.com/repos/ReactiveX/RxJava/assignees{/user}","branches_url":"https://api.github.com/repos/ReactiveX/RxJava/branches{/branch}","tags_url":"https://api.github.com/repos/ReactiveX/RxJava/tags","blobs_url":"https://api.github.com/repos/ReactiveX/RxJava/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ReactiveX/RxJava/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ReactiveX/RxJava/git/refs{/sha}","trees_url":"https://api.github.com/repos/ReactiveX/RxJava/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ReactiveX/RxJava/statuses/{sha}","languages_url":"https://api.github.com/repos/ReactiveX/RxJava/languages","stargazers_url":"https://api.github.com/repos/ReactiveX/RxJava/stargazers","contributors_url":"https://api.github.com/repos/ReactiveX/RxJava/contributors","subscribers_url":"https://api.github.com/repos/ReactiveX/RxJava/subscribers","subscription_url":"https://api.github.com/repos/ReactiveX/RxJava/subscription","commits_url":"https://api.github.com/repos/ReactiveX/RxJava/commits{/sha}","git_commits_url":"https://api.github.com/repos/ReactiveX/RxJava/git/commits{/sha}","comments_url":"https://api.github.com/repos/ReactiveX/RxJava/comments{/number}","issue_comment_url":"https://api.github.com/repos/ReactiveX/RxJava/issues/comments{/number}","contents_url":"https://api.github.com/repos/ReactiveX/RxJava/contents/{+path}","compare_url":"https://api.github.com/repos/ReactiveX/RxJava/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ReactiveX/RxJava/merges","archive_url":"https://api.github.com/repos/ReactiveX/RxJava/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ReactiveX/RxJava/downloads","issues_url":"https://api.github.com/repos/ReactiveX/RxJava/issues{/number}","pulls_url":"https://api.github.com/repos/ReactiveX/RxJava/pulls{/number}","milestones_url":"https://api.github.com/repos/ReactiveX/RxJava/milestones{/number}","notifications_url":"https://api.github.com/repos/ReactiveX/RxJava/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ReactiveX/RxJava/labels{/name}","releases_url":"https://api.github.com/repos/ReactiveX/RxJava/releases{/id}","created_at":"2013-01-08T20:11:48Z","updated_at":"2015-11-07T17:59:51Z","pushed_at":"2015-11-07T17:51:39Z","git_url":"git://github.com/ReactiveX/RxJava.git","ssh_url":"git@github.com:ReactiveX/RxJava.git","clone_url":"https://github.com/ReactiveX/RxJava.git","svn_url":"https://github.com/ReactiveX/RxJava","homepage":"","size":472217,"stargazers_count":8520,"watchers_count":8520,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1223,"mirror_url":null,"open_issues_count":197,"forks":1223,"open_issues":197,"watchers":8520,"default_branch":"1.x"}},"_links":{"self":{"href":"https://api.github.com/repos/ReactiveX/RxJava/pulls/3500"},"html":{"href":"https://github.com/ReactiveX/RxJava/pull/3500"},"issue":{"href":"https://api.github.com/repos/ReactiveX/RxJava/issues/3500"},"comments":{"href":"https://api.github.com/repos/ReactiveX/RxJava/issues/3500/comments"},"review_comments":{"href":"https://api.github.com/repos/ReactiveX/RxJava/pulls/3500/comments"},"review_comment":{"href":"https://api.github.com/repos/ReactiveX/RxJava/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ReactiveX/RxJava/pulls/3500/commits"},"statuses":{"href":"https://api.github.com/repos/ReactiveX/RxJava/statuses/d7183a898d6fa5360b76165558baef3276722119"}}}}