{"action":"created","comment":{"url":"https://api.github.com/repos/netty/netty/pulls/comments/28543507","id":28543507,"diff_hunk":"@@ -60,61 +61,15 @@ public int compare(CharSequence o1, CharSequence o2) {\n             if (o1 == o2) {\n                 return 0;\n             }\n-\n-            AsciiString a1 = o1 instanceof AsciiString ? (AsciiString) o1 : null;\n-            AsciiString a2 = o2 instanceof AsciiString ? (AsciiString) o2 : null;\n-\n-            int result;\n             int length1 = o1.length();\n             int length2 = o2.length();\n             int minLength = Math.min(length1, length2);\n-            if (a1 != null && a2 != null) {\n-                byte[] thisValue = a1.value;\n-                byte[] thatValue = a2.value;\n-                for (int i = 0; i < minLength; i++) {\n-                    byte v1 = thisValue[i];\n-                    byte v2 = thatValue[i];\n-                    if (v1 == v2) {\n-                        continue;\n-                    }\n-                    int c1 = toLowerCase(v1);\n-                    int c2 = toLowerCase(v2);\n-                    result = c1 - c2;\n-                    if (result != 0) {\n-                        return result;\n-                    }\n-                }\n-            } else if (a1 != null) {\n-                byte[] thisValue = a1.value;\n-                for (int i = 0; i < minLength; i++) {\n-                    int c1 = toLowerCase(thisValue[i]);\n-                    int c2 = toLowerCase(o2.charAt(i));\n-                    result = c1 - c2;\n-                    if (result != 0) {\n-                        return result;\n-                    }\n-                }\n-            } else if (a2 != null) {\n-                byte[] thatValue = a2.value;\n-                for (int i = 0; i < minLength; i++) {\n-                    int c1 = toLowerCase(o1.charAt(i));\n-                    int c2 = toLowerCase(thatValue[i]);\n-                    result = c1 - c2;\n-                    if (result != 0) {\n-                        return result;\n-                    }\n-                }\n-            } else {\n-                for (int i = 0; i < minLength; i++) {\n-                    int c1 = toLowerCase(o1.charAt(i));\n-                    int c2 = toLowerCase(o2.charAt(i));\n-                    result = c1 - c2;\n-                    if (result != 0) {\n-                        return result;\n-                    }\n+            for (int i = 0; i < minLength; i++) {\n+                int result = toLowerCase(o1.charAt(i)) - toLowerCase(o2.charAt(i));","path":"common/src/main/java/io/netty/util/AsciiString.java","position":87,"original_position":87,"commit_id":"07605ff89602c22230558d7d3cd96b0cf0083825","original_commit_id":"07605ff89602c22230558d7d3cd96b0cf0083825","user":{"login":"Scottmitch","id":7562868,"avatar_url":"https://avatars.githubusercontent.com/u/7562868?v=3","gravatar_id":"","url":"https://api.github.com/users/Scottmitch","html_url":"https://github.com/Scottmitch","followers_url":"https://api.github.com/users/Scottmitch/followers","following_url":"https://api.github.com/users/Scottmitch/following{/other_user}","gists_url":"https://api.github.com/users/Scottmitch/gists{/gist_id}","starred_url":"https://api.github.com/users/Scottmitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Scottmitch/subscriptions","organizations_url":"https://api.github.com/users/Scottmitch/orgs","repos_url":"https://api.github.com/users/Scottmitch/repos","events_url":"https://api.github.com/users/Scottmitch/events{/privacy}","received_events_url":"https://api.github.com/users/Scottmitch/received_events","type":"User","site_admin":false},"body":"I agree this is much cleaner :)  However do you have benchmarking to support this change is negligible?\r\n\r\nAlso I have a pending PR (mentioned here https://github.com/netty/netty/pull/3626#issuecomment-93554579) which adds `arrayOffset()` which may add additional overhead for adding offsets...and may also add bounds check for each `charAt(..)` call.","created_at":"2015-04-16T19:52:54Z","updated_at":"2015-04-16T19:52:54Z","html_url":"https://github.com/netty/netty/pull/3642#discussion_r28543507","pull_request_url":"https://api.github.com/repos/netty/netty/pulls/3642","_links":{"self":{"href":"https://api.github.com/repos/netty/netty/pulls/comments/28543507"},"html":{"href":"https://github.com/netty/netty/pull/3642#discussion_r28543507"},"pull_request":{"href":"https://api.github.com/repos/netty/netty/pulls/3642"}}},"pull_request":{"url":"https://api.github.com/repos/netty/netty/pulls/3642","id":33474075,"html_url":"https://github.com/netty/netty/pull/3642","diff_url":"https://github.com/netty/netty/pull/3642.diff","patch_url":"https://github.com/netty/netty/pull/3642.patch","issue_url":"https://api.github.com/repos/netty/netty/issues/3642","number":3642,"state":"open","locked":false,"title":"Small cleanup in headers and (Ascii|Binary)String.","user":{"login":"buchgr","id":1388179,"avatar_url":"https://avatars.githubusercontent.com/u/1388179?v=3","gravatar_id":"","url":"https://api.github.com/users/buchgr","html_url":"https://github.com/buchgr","followers_url":"https://api.github.com/users/buchgr/followers","following_url":"https://api.github.com/users/buchgr/following{/other_user}","gists_url":"https://api.github.com/users/buchgr/gists{/gist_id}","starred_url":"https://api.github.com/users/buchgr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buchgr/subscriptions","organizations_url":"https://api.github.com/users/buchgr/orgs","repos_url":"https://api.github.com/users/buchgr/repos","events_url":"https://api.github.com/users/buchgr/events{/privacy}","received_events_url":"https://api.github.com/users/buchgr/received_events","type":"User","site_admin":false},"body":"Motivation:\r\n\r\nNoticed some typos and unnecessary complex code blocks.\r\n\r\nModifications:\r\n\r\nFixed typos and simplified code.\r\n\r\nResult:\r\n\r\nCleaner code.","created_at":"2015-04-16T17:31:28Z","updated_at":"2015-04-16T19:52:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"884a3b59f0715fe5b81722bd526f01453d0c8fa9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/netty/netty/pulls/3642/commits","review_comments_url":"https://api.github.com/repos/netty/netty/pulls/3642/comments","review_comment_url":"https://api.github.com/repos/netty/netty/pulls/comments{/number}","comments_url":"https://api.github.com/repos/netty/netty/issues/3642/comments","statuses_url":"https://api.github.com/repos/netty/netty/statuses/07605ff89602c22230558d7d3cd96b0cf0083825","head":{"label":"buchgr:stringfixes","ref":"stringfixes","sha":"07605ff89602c22230558d7d3cd96b0cf0083825","user":{"login":"buchgr","id":1388179,"avatar_url":"https://avatars.githubusercontent.com/u/1388179?v=3","gravatar_id":"","url":"https://api.github.com/users/buchgr","html_url":"https://github.com/buchgr","followers_url":"https://api.github.com/users/buchgr/followers","following_url":"https://api.github.com/users/buchgr/following{/other_user}","gists_url":"https://api.github.com/users/buchgr/gists{/gist_id}","starred_url":"https://api.github.com/users/buchgr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buchgr/subscriptions","organizations_url":"https://api.github.com/users/buchgr/orgs","repos_url":"https://api.github.com/users/buchgr/repos","events_url":"https://api.github.com/users/buchgr/events{/privacy}","received_events_url":"https://api.github.com/users/buchgr/received_events","type":"User","site_admin":false},"repo":{"id":17233219,"name":"netty","full_name":"buchgr/netty","owner":{"login":"buchgr","id":1388179,"avatar_url":"https://avatars.githubusercontent.com/u/1388179?v=3","gravatar_id":"","url":"https://api.github.com/users/buchgr","html_url":"https://github.com/buchgr","followers_url":"https://api.github.com/users/buchgr/followers","following_url":"https://api.github.com/users/buchgr/following{/other_user}","gists_url":"https://api.github.com/users/buchgr/gists{/gist_id}","starred_url":"https://api.github.com/users/buchgr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buchgr/subscriptions","organizations_url":"https://api.github.com/users/buchgr/orgs","repos_url":"https://api.github.com/users/buchgr/repos","events_url":"https://api.github.com/users/buchgr/events{/privacy}","received_events_url":"https://api.github.com/users/buchgr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/buchgr/netty","description":"Netty project - an event-driven asynchronous network application framework","fork":true,"url":"https://api.github.com/repos/buchgr/netty","forks_url":"https://api.github.com/repos/buchgr/netty/forks","keys_url":"https://api.github.com/repos/buchgr/netty/keys{/key_id}","collaborators_url":"https://api.github.com/repos/buchgr/netty/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/buchgr/netty/teams","hooks_url":"https://api.github.com/repos/buchgr/netty/hooks","issue_events_url":"https://api.github.com/repos/buchgr/netty/issues/events{/number}","events_url":"https://api.github.com/repos/buchgr/netty/events","assignees_url":"https://api.github.com/repos/buchgr/netty/assignees{/user}","branches_url":"https://api.github.com/repos/buchgr/netty/branches{/branch}","tags_url":"https://api.github.com/repos/buchgr/netty/tags","blobs_url":"https://api.github.com/repos/buchgr/netty/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/buchgr/netty/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/buchgr/netty/git/refs{/sha}","trees_url":"https://api.github.com/repos/buchgr/netty/git/trees{/sha}","statuses_url":"https://api.github.com/repos/buchgr/netty/statuses/{sha}","languages_url":"https://api.github.com/repos/buchgr/netty/languages","stargazers_url":"https://api.github.com/repos/buchgr/netty/stargazers","contributors_url":"https://api.github.com/repos/buchgr/netty/contributors","subscribers_url":"https://api.github.com/repos/buchgr/netty/subscribers","subscription_url":"https://api.github.com/repos/buchgr/netty/subscription","commits_url":"https://api.github.com/repos/buchgr/netty/commits{/sha}","git_commits_url":"https://api.github.com/repos/buchgr/netty/git/commits{/sha}","comments_url":"https://api.github.com/repos/buchgr/netty/comments{/number}","issue_comment_url":"https://api.github.com/repos/buchgr/netty/issues/comments{/number}","contents_url":"https://api.github.com/repos/buchgr/netty/contents/{+path}","compare_url":"https://api.github.com/repos/buchgr/netty/compare/{base}...{head}","merges_url":"https://api.github.com/repos/buchgr/netty/merges","archive_url":"https://api.github.com/repos/buchgr/netty/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/buchgr/netty/downloads","issues_url":"https://api.github.com/repos/buchgr/netty/issues{/number}","pulls_url":"https://api.github.com/repos/buchgr/netty/pulls{/number}","milestones_url":"https://api.github.com/repos/buchgr/netty/milestones{/number}","notifications_url":"https://api.github.com/repos/buchgr/netty/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/buchgr/netty/labels{/name}","releases_url":"https://api.github.com/repos/buchgr/netty/releases{/id}","created_at":"2014-02-27T02:09:39Z","updated_at":"2015-03-10T20:55:16Z","pushed_at":"2015-04-16T19:51:05Z","git_url":"git://github.com/buchgr/netty.git","ssh_url":"git@github.com:buchgr/netty.git","clone_url":"https://github.com/buchgr/netty.git","svn_url":"https://github.com/buchgr/netty","homepage":"http://netty.io/","size":40275,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":0,"forks":2,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"netty:master","ref":"master","sha":"7e8ab2118dd5d40dce57e6fbdd589924ef24fd73","user":{"login":"netty","id":473791,"avatar_url":"https://avatars.githubusercontent.com/u/473791?v=3","gravatar_id":"","url":"https://api.github.com/users/netty","html_url":"https://github.com/netty","followers_url":"https://api.github.com/users/netty/followers","following_url":"https://api.github.com/users/netty/following{/other_user}","gists_url":"https://api.github.com/users/netty/gists{/gist_id}","starred_url":"https://api.github.com/users/netty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/netty/subscriptions","organizations_url":"https://api.github.com/users/netty/orgs","repos_url":"https://api.github.com/users/netty/repos","events_url":"https://api.github.com/users/netty/events{/privacy}","received_events_url":"https://api.github.com/users/netty/received_events","type":"Organization","site_admin":false},"repo":{"id":1064563,"name":"netty","full_name":"netty/netty","owner":{"login":"netty","id":473791,"avatar_url":"https://avatars.githubusercontent.com/u/473791?v=3","gravatar_id":"","url":"https://api.github.com/users/netty","html_url":"https://github.com/netty","followers_url":"https://api.github.com/users/netty/followers","following_url":"https://api.github.com/users/netty/following{/other_user}","gists_url":"https://api.github.com/users/netty/gists{/gist_id}","starred_url":"https://api.github.com/users/netty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/netty/subscriptions","organizations_url":"https://api.github.com/users/netty/orgs","repos_url":"https://api.github.com/users/netty/repos","events_url":"https://api.github.com/users/netty/events{/privacy}","received_events_url":"https://api.github.com/users/netty/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/netty/netty","description":"Netty project - an event-driven asynchronous network application framework","fork":false,"url":"https://api.github.com/repos/netty/netty","forks_url":"https://api.github.com/repos/netty/netty/forks","keys_url":"https://api.github.com/repos/netty/netty/keys{/key_id}","collaborators_url":"https://api.github.com/repos/netty/netty/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/netty/netty/teams","hooks_url":"https://api.github.com/repos/netty/netty/hooks","issue_events_url":"https://api.github.com/repos/netty/netty/issues/events{/number}","events_url":"https://api.github.com/repos/netty/netty/events","assignees_url":"https://api.github.com/repos/netty/netty/assignees{/user}","branches_url":"https://api.github.com/repos/netty/netty/branches{/branch}","tags_url":"https://api.github.com/repos/netty/netty/tags","blobs_url":"https://api.github.com/repos/netty/netty/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/netty/netty/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/netty/netty/git/refs{/sha}","trees_url":"https://api.github.com/repos/netty/netty/git/trees{/sha}","statuses_url":"https://api.github.com/repos/netty/netty/statuses/{sha}","languages_url":"https://api.github.com/repos/netty/netty/languages","stargazers_url":"https://api.github.com/repos/netty/netty/stargazers","contributors_url":"https://api.github.com/repos/netty/netty/contributors","subscribers_url":"https://api.github.com/repos/netty/netty/subscribers","subscription_url":"https://api.github.com/repos/netty/netty/subscription","commits_url":"https://api.github.com/repos/netty/netty/commits{/sha}","git_commits_url":"https://api.github.com/repos/netty/netty/git/commits{/sha}","comments_url":"https://api.github.com/repos/netty/netty/comments{/number}","issue_comment_url":"https://api.github.com/repos/netty/netty/issues/comments{/number}","contents_url":"https://api.github.com/repos/netty/netty/contents/{+path}","compare_url":"https://api.github.com/repos/netty/netty/compare/{base}...{head}","merges_url":"https://api.github.com/repos/netty/netty/merges","archive_url":"https://api.github.com/repos/netty/netty/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/netty/netty/downloads","issues_url":"https://api.github.com/repos/netty/netty/issues{/number}","pulls_url":"https://api.github.com/repos/netty/netty/pulls{/number}","milestones_url":"https://api.github.com/repos/netty/netty/milestones{/number}","notifications_url":"https://api.github.com/repos/netty/netty/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/netty/netty/labels{/name}","releases_url":"https://api.github.com/repos/netty/netty/releases{/id}","created_at":"2010-11-09T09:22:21Z","updated_at":"2015-04-16T19:27:57Z","pushed_at":"2015-04-16T19:51:07Z","git_url":"git://github.com/netty/netty.git","ssh_url":"git@github.com:netty/netty.git","clone_url":"https://github.com/netty/netty.git","svn_url":"https://github.com/netty/netty","homepage":"http://netty.io/","size":117117,"stargazers_count":4426,"watchers_count":4426,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2178,"mirror_url":null,"open_issues_count":249,"forks":2178,"open_issues":249,"watchers":4426,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/netty/netty/pulls/3642"},"html":{"href":"https://github.com/netty/netty/pull/3642"},"issue":{"href":"https://api.github.com/repos/netty/netty/issues/3642"},"comments":{"href":"https://api.github.com/repos/netty/netty/issues/3642/comments"},"review_comments":{"href":"https://api.github.com/repos/netty/netty/pulls/3642/comments"},"review_comment":{"href":"https://api.github.com/repos/netty/netty/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/netty/netty/pulls/3642/commits"},"statuses":{"href":"https://api.github.com/repos/netty/netty/statuses/07605ff89602c22230558d7d3cd96b0cf0083825"}}}}