{"action":"created","comment":{"url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/pulls/comments/46099144","id":46099144,"diff_hunk":"@@ -7,9 +7,18 @@ Note that there is already a `swap` function in the standard library. However, y\n \n */\n \n-func insertionSort<T>(var array: [T], @noescape isOrderedBefore: (T, T) -> Bool) -> [T] {\n-\n-    return array\n+func insertionSort<T>( array: [T], @noescape isOrderedBefore: (T, T) -> Bool) -> [T] {\n+    var sortedArray : [T] = []","path":"Assignments/Sorting/InsertionSort.playground/Pages/Insertion Sort.xcplaygroundpage/Contents.swift","position":8,"original_position":8,"commit_id":"39466b3a6040056525e002a9a8d2b8de5d395ec1","original_commit_id":"39466b3a6040056525e002a9a8d2b8de5d395ec1","user":{"login":"aranasaurus","id":260004,"avatar_url":"https://avatars.githubusercontent.com/u/260004?v=3","gravatar_id":"","url":"https://api.github.com/users/aranasaurus","html_url":"https://github.com/aranasaurus","followers_url":"https://api.github.com/users/aranasaurus/followers","following_url":"https://api.github.com/users/aranasaurus/following{/other_user}","gists_url":"https://api.github.com/users/aranasaurus/gists{/gist_id}","starred_url":"https://api.github.com/users/aranasaurus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aranasaurus/subscriptions","organizations_url":"https://api.github.com/users/aranasaurus/orgs","repos_url":"https://api.github.com/users/aranasaurus/repos","events_url":"https://api.github.com/users/aranasaurus/events{/privacy}","received_events_url":"https://api.github.com/users/aranasaurus/received_events","type":"User","site_admin":false},"body":"The original function signature declared the `array` parameter as `var` which will give you a copy of the data that is mutable. Removing the `var` from the declaration still gets you a _copy_ of the array, but an immutable one. Here you're creating a _3rd_ copy of the data. This is fine for small arrays of strings or integers but it may be prohibitively inefficient with larger datasets. ","created_at":"2015-11-29T22:25:52Z","updated_at":"2015-11-29T22:25:52Z","html_url":"https://github.com/gmertk/SwiftAlgorithmsClassroom/pull/18#discussion_r46099144","pull_request_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/pulls/18","_links":{"self":{"href":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/pulls/comments/46099144"},"html":{"href":"https://github.com/gmertk/SwiftAlgorithmsClassroom/pull/18#discussion_r46099144"},"pull_request":{"href":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/pulls/18"}}},"pull_request":{"url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/pulls/18","id":52033788,"html_url":"https://github.com/gmertk/SwiftAlgorithmsClassroom/pull/18","diff_url":"https://github.com/gmertk/SwiftAlgorithmsClassroom/pull/18.diff","patch_url":"https://github.com/gmertk/SwiftAlgorithmsClassroom/pull/18.patch","issue_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/issues/18","number":18,"state":"open","locked":false,"title":"solution","user":{"login":"dingua","id":438958,"avatar_url":"https://avatars.githubusercontent.com/u/438958?v=3","gravatar_id":"","url":"https://api.github.com/users/dingua","html_url":"https://github.com/dingua","followers_url":"https://api.github.com/users/dingua/followers","following_url":"https://api.github.com/users/dingua/following{/other_user}","gists_url":"https://api.github.com/users/dingua/gists{/gist_id}","starred_url":"https://api.github.com/users/dingua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dingua/subscriptions","organizations_url":"https://api.github.com/users/dingua/orgs","repos_url":"https://api.github.com/users/dingua/repos","events_url":"https://api.github.com/users/dingua/events{/privacy}","received_events_url":"https://api.github.com/users/dingua/received_events","type":"User","site_admin":false},"body":"resolve assignment 2","created_at":"2015-11-28T05:22:10Z","updated_at":"2015-11-29T22:25:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"91115688109e0840191af5884f806a9bcd086c3d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/pulls/18/commits","review_comments_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/pulls/18/comments","review_comment_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/issues/18/comments","statuses_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/statuses/39466b3a6040056525e002a9a8d2b8de5d395ec1","head":{"label":"dingua:assignment002","ref":"assignment002","sha":"39466b3a6040056525e002a9a8d2b8de5d395ec1","user":{"login":"dingua","id":438958,"avatar_url":"https://avatars.githubusercontent.com/u/438958?v=3","gravatar_id":"","url":"https://api.github.com/users/dingua","html_url":"https://github.com/dingua","followers_url":"https://api.github.com/users/dingua/followers","following_url":"https://api.github.com/users/dingua/following{/other_user}","gists_url":"https://api.github.com/users/dingua/gists{/gist_id}","starred_url":"https://api.github.com/users/dingua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dingua/subscriptions","organizations_url":"https://api.github.com/users/dingua/orgs","repos_url":"https://api.github.com/users/dingua/repos","events_url":"https://api.github.com/users/dingua/events{/privacy}","received_events_url":"https://api.github.com/users/dingua/received_events","type":"User","site_admin":false},"repo":{"id":46772573,"name":"SwiftAlgorithmsClassroom","full_name":"dingua/SwiftAlgorithmsClassroom","owner":{"login":"dingua","id":438958,"avatar_url":"https://avatars.githubusercontent.com/u/438958?v=3","gravatar_id":"","url":"https://api.github.com/users/dingua","html_url":"https://github.com/dingua","followers_url":"https://api.github.com/users/dingua/followers","following_url":"https://api.github.com/users/dingua/following{/other_user}","gists_url":"https://api.github.com/users/dingua/gists{/gist_id}","starred_url":"https://api.github.com/users/dingua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dingua/subscriptions","organizations_url":"https://api.github.com/users/dingua/orgs","repos_url":"https://api.github.com/users/dingua/repos","events_url":"https://api.github.com/users/dingua/events{/privacy}","received_events_url":"https://api.github.com/users/dingua/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dingua/SwiftAlgorithmsClassroom","description":"An experimental classroom to learn/teach algorithms and data structures with Swift","fork":true,"url":"https://api.github.com/repos/dingua/SwiftAlgorithmsClassroom","forks_url":"https://api.github.com/repos/dingua/SwiftAlgorithmsClassroom/forks","keys_url":"https://api.github.com/repos/dingua/SwiftAlgorithmsClassroom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dingua/SwiftAlgorithmsClassroom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dingua/SwiftAlgorithmsClassroom/teams","hooks_url":"https://api.github.com/repos/dingua/SwiftAlgorithmsClassroom/hooks","issue_events_url":"https://api.github.com/repos/dingua/SwiftAlgorithmsClassroom/issues/events{/number}","events_url":"https://api.github.com/repos/dingua/SwiftAlgorithmsClassroom/events","assignees_url":"https://api.github.com/repos/dingua/SwiftAlgorithmsClassroom/assignees{/user}","branches_url":"https://api.github.com/repos/dingua/SwiftAlgorithmsClassroom/branches{/branch}","tags_url":"https://api.github.com/repos/dingua/SwiftAlgorithmsClassroom/tags","blobs_url":"https://api.github.com/repos/dingua/SwiftAlgorithmsClassroom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dingua/SwiftAlgorithmsClassroom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dingua/SwiftAlgorithmsClassroom/git/refs{/sha}","trees_url":"https://api.github.com/repos/dingua/SwiftAlgorithmsClassroom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dingua/SwiftAlgorithmsClassroom/statuses/{sha}","languages_url":"https://api.github.com/repos/dingua/SwiftAlgorithmsClassroom/languages","stargazers_url":"https://api.github.com/repos/dingua/SwiftAlgorithmsClassroom/stargazers","contributors_url":"https://api.github.com/repos/dingua/SwiftAlgorithmsClassroom/contributors","subscribers_url":"https://api.github.com/repos/dingua/SwiftAlgorithmsClassroom/subscribers","subscription_url":"https://api.github.com/repos/dingua/SwiftAlgorithmsClassroom/subscription","commits_url":"https://api.github.com/repos/dingua/SwiftAlgorithmsClassroom/commits{/sha}","git_commits_url":"https://api.github.com/repos/dingua/SwiftAlgorithmsClassroom/git/commits{/sha}","comments_url":"https://api.github.com/repos/dingua/SwiftAlgorithmsClassroom/comments{/number}","issue_comment_url":"https://api.github.com/repos/dingua/SwiftAlgorithmsClassroom/issues/comments{/number}","contents_url":"https://api.github.com/repos/dingua/SwiftAlgorithmsClassroom/contents/{+path}","compare_url":"https://api.github.com/repos/dingua/SwiftAlgorithmsClassroom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dingua/SwiftAlgorithmsClassroom/merges","archive_url":"https://api.github.com/repos/dingua/SwiftAlgorithmsClassroom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dingua/SwiftAlgorithmsClassroom/downloads","issues_url":"https://api.github.com/repos/dingua/SwiftAlgorithmsClassroom/issues{/number}","pulls_url":"https://api.github.com/repos/dingua/SwiftAlgorithmsClassroom/pulls{/number}","milestones_url":"https://api.github.com/repos/dingua/SwiftAlgorithmsClassroom/milestones{/number}","notifications_url":"https://api.github.com/repos/dingua/SwiftAlgorithmsClassroom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dingua/SwiftAlgorithmsClassroom/labels{/name}","releases_url":"https://api.github.com/repos/dingua/SwiftAlgorithmsClassroom/releases{/id}","created_at":"2015-11-24T06:45:23Z","updated_at":"2015-11-24T06:45:23Z","pushed_at":"2015-11-28T05:21:25Z","git_url":"git://github.com/dingua/SwiftAlgorithmsClassroom.git","ssh_url":"git@github.com:dingua/SwiftAlgorithmsClassroom.git","clone_url":"https://github.com/dingua/SwiftAlgorithmsClassroom.git","svn_url":"https://github.com/dingua/SwiftAlgorithmsClassroom","homepage":"","size":11780,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"gmertk:assignment002","ref":"assignment002","sha":"eabbc27c57cea7673ccbee9d80fd6eb0556551ff","user":{"login":"gmertk","id":907281,"avatar_url":"https://avatars.githubusercontent.com/u/907281?v=3","gravatar_id":"","url":"https://api.github.com/users/gmertk","html_url":"https://github.com/gmertk","followers_url":"https://api.github.com/users/gmertk/followers","following_url":"https://api.github.com/users/gmertk/following{/other_user}","gists_url":"https://api.github.com/users/gmertk/gists{/gist_id}","starred_url":"https://api.github.com/users/gmertk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmertk/subscriptions","organizations_url":"https://api.github.com/users/gmertk/orgs","repos_url":"https://api.github.com/users/gmertk/repos","events_url":"https://api.github.com/users/gmertk/events{/privacy}","received_events_url":"https://api.github.com/users/gmertk/received_events","type":"User","site_admin":false},"repo":{"id":46218472,"name":"SwiftAlgorithmsClassroom","full_name":"gmertk/SwiftAlgorithmsClassroom","owner":{"login":"gmertk","id":907281,"avatar_url":"https://avatars.githubusercontent.com/u/907281?v=3","gravatar_id":"","url":"https://api.github.com/users/gmertk","html_url":"https://github.com/gmertk","followers_url":"https://api.github.com/users/gmertk/followers","following_url":"https://api.github.com/users/gmertk/following{/other_user}","gists_url":"https://api.github.com/users/gmertk/gists{/gist_id}","starred_url":"https://api.github.com/users/gmertk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmertk/subscriptions","organizations_url":"https://api.github.com/users/gmertk/orgs","repos_url":"https://api.github.com/users/gmertk/repos","events_url":"https://api.github.com/users/gmertk/events{/privacy}","received_events_url":"https://api.github.com/users/gmertk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gmertk/SwiftAlgorithmsClassroom","description":"An experimental classroom to learn/teach algorithms and data structures with Swift","fork":false,"url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom","forks_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/forks","keys_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/teams","hooks_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/hooks","issue_events_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/issues/events{/number}","events_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/events","assignees_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/assignees{/user}","branches_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/branches{/branch}","tags_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/tags","blobs_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/git/refs{/sha}","trees_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/statuses/{sha}","languages_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/languages","stargazers_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/stargazers","contributors_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/contributors","subscribers_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/subscribers","subscription_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/subscription","commits_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/commits{/sha}","git_commits_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/git/commits{/sha}","comments_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/comments{/number}","issue_comment_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/issues/comments{/number}","contents_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/contents/{+path}","compare_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/merges","archive_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/downloads","issues_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/issues{/number}","pulls_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/pulls{/number}","milestones_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/milestones{/number}","notifications_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/labels{/name}","releases_url":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/releases{/id}","created_at":"2015-11-15T13:23:37Z","updated_at":"2015-11-29T22:19:41Z","pushed_at":"2015-11-29T22:11:42Z","git_url":"git://github.com/gmertk/SwiftAlgorithmsClassroom.git","ssh_url":"git@github.com:gmertk/SwiftAlgorithmsClassroom.git","clone_url":"https://github.com/gmertk/SwiftAlgorithmsClassroom.git","svn_url":"https://github.com/gmertk/SwiftAlgorithmsClassroom","homepage":"","size":11820,"stargazers_count":400,"watchers_count":400,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":46,"mirror_url":null,"open_issues_count":8,"forks":46,"open_issues":8,"watchers":400,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/pulls/18"},"html":{"href":"https://github.com/gmertk/SwiftAlgorithmsClassroom/pull/18"},"issue":{"href":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/issues/18"},"comments":{"href":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/issues/18/comments"},"review_comments":{"href":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/pulls/18/comments"},"review_comment":{"href":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/pulls/18/commits"},"statuses":{"href":"https://api.github.com/repos/gmertk/SwiftAlgorithmsClassroom/statuses/39466b3a6040056525e002a9a8d2b8de5d395ec1"}}}}