{"action":"created","comment":{"url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/pulls/comments/238097145","pull_request_review_id":180559951,"id":238097145,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzODA5NzE0NQ==","diff_hunk":"@@ -19,8 +19,33 @@ public extension StringProtocol where Index == String.Index {\n     ///     - Parameter options: Options for the comparison.\n     /// - Returns: The longest common suffix of the receiver and the given String\n     public func commonSuffix<T: StringProtocol>(with aString: T, options: String.CompareOptions = []) -> String {\n-        let reversedSuffix = String(reversed()).commonPrefix(with: String(aString.reversed()), options: options)","path":"Sources/Extensions/SwiftStdlib/StringProtocolExtensions.swift","position":13,"original_position":13,"commit_id":"59174618d1d88ce05092764e77edb1c60347d764","original_commit_id":"a69b41e79290e99bb098a9e9cefed8049ae3c5f6","user":{"login":"LucianoPAlmeida","id":8292651,"node_id":"MDQ6VXNlcjgyOTI2NTE=","avatar_url":"https://avatars0.githubusercontent.com/u/8292651?v=4","gravatar_id":"","url":"https://api.github.com/users/LucianoPAlmeida","html_url":"https://github.com/LucianoPAlmeida","followers_url":"https://api.github.com/users/LucianoPAlmeida/followers","following_url":"https://api.github.com/users/LucianoPAlmeida/following{/other_user}","gists_url":"https://api.github.com/users/LucianoPAlmeida/gists{/gist_id}","starred_url":"https://api.github.com/users/LucianoPAlmeida/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LucianoPAlmeida/subscriptions","organizations_url":"https://api.github.com/users/LucianoPAlmeida/orgs","repos_url":"https://api.github.com/users/LucianoPAlmeida/repos","events_url":"https://api.github.com/users/LucianoPAlmeida/events{/privacy}","received_events_url":"https://api.github.com/users/LucianoPAlmeida/received_events","type":"User","site_admin":false},"body":"In the end, I think both implementations seem to have the same performance gain (avoid eager reverse). And using for with lazy reversed and Zip2Sequence to walk the strings by the index are just a simple implementation detail and more personal preference. So I think there's not a big problem to let this implementation here. :)) Let me know what you think.\r\ncc @omaralbeik @SD10 Thoughts?","created_at":"2018-12-02T12:42:52Z","updated_at":"2018-12-02T12:42:53Z","html_url":"https://github.com/SwifterSwift/SwifterSwift/pull/606#discussion_r238097145","pull_request_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/pulls/606","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/SwifterSwift/SwifterSwift/pulls/comments/238097145"},"html":{"href":"https://github.com/SwifterSwift/SwifterSwift/pull/606#discussion_r238097145"},"pull_request":{"href":"https://api.github.com/repos/SwifterSwift/SwifterSwift/pulls/606"}},"in_reply_to_id":235978166},"pull_request":{"url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/pulls/606","id":231726911,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMxNzI2OTEx","html_url":"https://github.com/SwifterSwift/SwifterSwift/pull/606","diff_url":"https://github.com/SwifterSwift/SwifterSwift/pull/606.diff","patch_url":"https://github.com/SwifterSwift/SwifterSwift/pull/606.patch","issue_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/issues/606","number":606,"state":"open","locked":false,"title":"Improvement common suffix extension","user":{"login":"LucianoPAlmeida","id":8292651,"node_id":"MDQ6VXNlcjgyOTI2NTE=","avatar_url":"https://avatars0.githubusercontent.com/u/8292651?v=4","gravatar_id":"","url":"https://api.github.com/users/LucianoPAlmeida","html_url":"https://github.com/LucianoPAlmeida","followers_url":"https://api.github.com/users/LucianoPAlmeida/followers","following_url":"https://api.github.com/users/LucianoPAlmeida/following{/other_user}","gists_url":"https://api.github.com/users/LucianoPAlmeida/gists{/gist_id}","starred_url":"https://api.github.com/users/LucianoPAlmeida/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LucianoPAlmeida/subscriptions","organizations_url":"https://api.github.com/users/LucianoPAlmeida/orgs","repos_url":"https://api.github.com/users/LucianoPAlmeida/repos","events_url":"https://api.github.com/users/LucianoPAlmeida/events{/privacy}","received_events_url":"https://api.github.com/users/LucianoPAlmeida/received_events","type":"User","site_admin":false},"body":"Notice that the old implementation was not so performant because it was eagerly reversing the string and creating new strings copies. Just improving implementation and tests based on [Core libs Foundation](https://github.com/apple/swift-corelibs-foundation/blob/c82398aa779dd820c0f664b17197d9ed78e7052d/TestFoundation/TestNSString.swift#L1311) \r\n\r\n## Checklist\r\n<!--- Please go over all the following points, and put an `x` in all the boxes that apply. -->\r\n<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->\r\n- [x] I checked the [**Contributing Guidelines**](https://github.com/SwifterSwift/SwifterSwift/blob/master/CONTRIBUTING.md) before creating this request.\r\n- [x] New extensions are written in Swift 4.\r\n- [x] New extensions support iOS 8.0+ / tvOS 9.0+ / macOS 10.10+ / watchOS 2.0+.\r\n- [x] I have added tests for new extensions, and they passed.\r\n- [x] All extensions have a **clear** comments explaining their functionality, all parameters and return type in English.\r\n- [x] All extensions are declared as **public**.\r\n- [x] I have added a [changelog](https://github.com/SwifterSwift/SwifterSwift/blob/master/CHANGELOG_GUIDELINES.md) entry describing my changes.","created_at":"2018-11-17T13:04:24Z","updated_at":"2018-12-02T12:42:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8fb016d6778f586d88b47d2585383eeab47299f4","assignee":null,"assignees":[],"requested_reviewers":[{"login":"SD10","id":7445580,"node_id":"MDQ6VXNlcjc0NDU1ODA=","avatar_url":"https://avatars0.githubusercontent.com/u/7445580?v=4","gravatar_id":"","url":"https://api.github.com/users/SD10","html_url":"https://github.com/SD10","followers_url":"https://api.github.com/users/SD10/followers","following_url":"https://api.github.com/users/SD10/following{/other_user}","gists_url":"https://api.github.com/users/SD10/gists{/gist_id}","starred_url":"https://api.github.com/users/SD10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SD10/subscriptions","organizations_url":"https://api.github.com/users/SD10/orgs","repos_url":"https://api.github.com/users/SD10/repos","events_url":"https://api.github.com/users/SD10/events{/privacy}","received_events_url":"https://api.github.com/users/SD10/received_events","type":"User","site_admin":false},{"login":"omaralbeik","id":8127757,"node_id":"MDQ6VXNlcjgxMjc3NTc=","avatar_url":"https://avatars2.githubusercontent.com/u/8127757?v=4","gravatar_id":"","url":"https://api.github.com/users/omaralbeik","html_url":"https://github.com/omaralbeik","followers_url":"https://api.github.com/users/omaralbeik/followers","following_url":"https://api.github.com/users/omaralbeik/following{/other_user}","gists_url":"https://api.github.com/users/omaralbeik/gists{/gist_id}","starred_url":"https://api.github.com/users/omaralbeik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omaralbeik/subscriptions","organizations_url":"https://api.github.com/users/omaralbeik/orgs","repos_url":"https://api.github.com/users/omaralbeik/repos","events_url":"https://api.github.com/users/omaralbeik/events{/privacy}","received_events_url":"https://api.github.com/users/omaralbeik/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/pulls/606/commits","review_comments_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/pulls/606/comments","review_comment_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/issues/606/comments","statuses_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/statuses/59174618d1d88ce05092764e77edb1c60347d764","head":{"label":"SwifterSwift:improvement-common-suffix","ref":"improvement-common-suffix","sha":"59174618d1d88ce05092764e77edb1c60347d764","user":{"login":"SwifterSwift","id":25029478,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1MDI5NDc4","avatar_url":"https://avatars2.githubusercontent.com/u/25029478?v=4","gravatar_id":"","url":"https://api.github.com/users/SwifterSwift","html_url":"https://github.com/SwifterSwift","followers_url":"https://api.github.com/users/SwifterSwift/followers","following_url":"https://api.github.com/users/SwifterSwift/following{/other_user}","gists_url":"https://api.github.com/users/SwifterSwift/gists{/gist_id}","starred_url":"https://api.github.com/users/SwifterSwift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SwifterSwift/subscriptions","organizations_url":"https://api.github.com/users/SwifterSwift/orgs","repos_url":"https://api.github.com/users/SwifterSwift/repos","events_url":"https://api.github.com/users/SwifterSwift/events{/privacy}","received_events_url":"https://api.github.com/users/SwifterSwift/received_events","type":"Organization","site_admin":false},"repo":{"id":64705781,"node_id":"MDEwOlJlcG9zaXRvcnk2NDcwNTc4MQ==","name":"SwifterSwift","full_name":"SwifterSwift/SwifterSwift","private":false,"owner":{"login":"SwifterSwift","id":25029478,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1MDI5NDc4","avatar_url":"https://avatars2.githubusercontent.com/u/25029478?v=4","gravatar_id":"","url":"https://api.github.com/users/SwifterSwift","html_url":"https://github.com/SwifterSwift","followers_url":"https://api.github.com/users/SwifterSwift/followers","following_url":"https://api.github.com/users/SwifterSwift/following{/other_user}","gists_url":"https://api.github.com/users/SwifterSwift/gists{/gist_id}","starred_url":"https://api.github.com/users/SwifterSwift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SwifterSwift/subscriptions","organizations_url":"https://api.github.com/users/SwifterSwift/orgs","repos_url":"https://api.github.com/users/SwifterSwift/repos","events_url":"https://api.github.com/users/SwifterSwift/events{/privacy}","received_events_url":"https://api.github.com/users/SwifterSwift/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/SwifterSwift/SwifterSwift","description":"A handy collection of more than 500 native Swift extensions to boost your productivity.","fork":false,"url":"https://api.github.com/repos/SwifterSwift/SwifterSwift","forks_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/forks","keys_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/teams","hooks_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/hooks","issue_events_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/issues/events{/number}","events_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/events","assignees_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/assignees{/user}","branches_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/branches{/branch}","tags_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/tags","blobs_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/git/refs{/sha}","trees_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/statuses/{sha}","languages_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/languages","stargazers_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/stargazers","contributors_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/contributors","subscribers_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/subscribers","subscription_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/subscription","commits_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/commits{/sha}","git_commits_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/git/commits{/sha}","comments_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/comments{/number}","issue_comment_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/issues/comments{/number}","contents_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/contents/{+path}","compare_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/merges","archive_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/downloads","issues_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/issues{/number}","pulls_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/pulls{/number}","milestones_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/milestones{/number}","notifications_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/labels{/name}","releases_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/releases{/id}","deployments_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/deployments","created_at":"2016-08-01T22:25:24Z","updated_at":"2018-12-01T18:10:03Z","pushed_at":"2018-12-02T12:28:56Z","git_url":"git://github.com/SwifterSwift/SwifterSwift.git","ssh_url":"git@github.com:SwifterSwift/SwifterSwift.git","clone_url":"https://github.com/SwifterSwift/SwifterSwift.git","svn_url":"https://github.com/SwifterSwift/SwifterSwift","homepage":"https://swifterswift.com","size":14678,"stargazers_count":6457,"watchers_count":6457,"language":"Swift","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":729,"mirror_url":null,"archived":false,"open_issues_count":23,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":729,"open_issues":23,"watchers":6457,"default_branch":"master"}},"base":{"label":"SwifterSwift:master","ref":"master","sha":"b9638f305e99bc1579536eee86ec279e55f897e5","user":{"login":"SwifterSwift","id":25029478,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1MDI5NDc4","avatar_url":"https://avatars2.githubusercontent.com/u/25029478?v=4","gravatar_id":"","url":"https://api.github.com/users/SwifterSwift","html_url":"https://github.com/SwifterSwift","followers_url":"https://api.github.com/users/SwifterSwift/followers","following_url":"https://api.github.com/users/SwifterSwift/following{/other_user}","gists_url":"https://api.github.com/users/SwifterSwift/gists{/gist_id}","starred_url":"https://api.github.com/users/SwifterSwift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SwifterSwift/subscriptions","organizations_url":"https://api.github.com/users/SwifterSwift/orgs","repos_url":"https://api.github.com/users/SwifterSwift/repos","events_url":"https://api.github.com/users/SwifterSwift/events{/privacy}","received_events_url":"https://api.github.com/users/SwifterSwift/received_events","type":"Organization","site_admin":false},"repo":{"id":64705781,"node_id":"MDEwOlJlcG9zaXRvcnk2NDcwNTc4MQ==","name":"SwifterSwift","full_name":"SwifterSwift/SwifterSwift","private":false,"owner":{"login":"SwifterSwift","id":25029478,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI1MDI5NDc4","avatar_url":"https://avatars2.githubusercontent.com/u/25029478?v=4","gravatar_id":"","url":"https://api.github.com/users/SwifterSwift","html_url":"https://github.com/SwifterSwift","followers_url":"https://api.github.com/users/SwifterSwift/followers","following_url":"https://api.github.com/users/SwifterSwift/following{/other_user}","gists_url":"https://api.github.com/users/SwifterSwift/gists{/gist_id}","starred_url":"https://api.github.com/users/SwifterSwift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SwifterSwift/subscriptions","organizations_url":"https://api.github.com/users/SwifterSwift/orgs","repos_url":"https://api.github.com/users/SwifterSwift/repos","events_url":"https://api.github.com/users/SwifterSwift/events{/privacy}","received_events_url":"https://api.github.com/users/SwifterSwift/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/SwifterSwift/SwifterSwift","description":"A handy collection of more than 500 native Swift extensions to boost your productivity.","fork":false,"url":"https://api.github.com/repos/SwifterSwift/SwifterSwift","forks_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/forks","keys_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/teams","hooks_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/hooks","issue_events_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/issues/events{/number}","events_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/events","assignees_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/assignees{/user}","branches_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/branches{/branch}","tags_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/tags","blobs_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/git/refs{/sha}","trees_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/statuses/{sha}","languages_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/languages","stargazers_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/stargazers","contributors_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/contributors","subscribers_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/subscribers","subscription_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/subscription","commits_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/commits{/sha}","git_commits_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/git/commits{/sha}","comments_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/comments{/number}","issue_comment_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/issues/comments{/number}","contents_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/contents/{+path}","compare_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/merges","archive_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/downloads","issues_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/issues{/number}","pulls_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/pulls{/number}","milestones_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/milestones{/number}","notifications_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/labels{/name}","releases_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/releases{/id}","deployments_url":"https://api.github.com/repos/SwifterSwift/SwifterSwift/deployments","created_at":"2016-08-01T22:25:24Z","updated_at":"2018-12-01T18:10:03Z","pushed_at":"2018-12-02T12:28:56Z","git_url":"git://github.com/SwifterSwift/SwifterSwift.git","ssh_url":"git@github.com:SwifterSwift/SwifterSwift.git","clone_url":"https://github.com/SwifterSwift/SwifterSwift.git","svn_url":"https://github.com/SwifterSwift/SwifterSwift","homepage":"https://swifterswift.com","size":14678,"stargazers_count":6457,"watchers_count":6457,"language":"Swift","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":729,"mirror_url":null,"archived":false,"open_issues_count":23,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":729,"open_issues":23,"watchers":6457,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SwifterSwift/SwifterSwift/pulls/606"},"html":{"href":"https://github.com/SwifterSwift/SwifterSwift/pull/606"},"issue":{"href":"https://api.github.com/repos/SwifterSwift/SwifterSwift/issues/606"},"comments":{"href":"https://api.github.com/repos/SwifterSwift/SwifterSwift/issues/606/comments"},"review_comments":{"href":"https://api.github.com/repos/SwifterSwift/SwifterSwift/pulls/606/comments"},"review_comment":{"href":"https://api.github.com/repos/SwifterSwift/SwifterSwift/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SwifterSwift/SwifterSwift/pulls/606/commits"},"statuses":{"href":"https://api.github.com/repos/SwifterSwift/SwifterSwift/statuses/59174618d1d88ce05092764e77edb1c60347d764"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"LucianoPAlmeida"}}