{"action":"created","comment":{"url":"https://api.github.com/repos/scala/collection-strawman/pulls/comments/174826117","pull_request_review_id":104253172,"id":174826117,"diff_hunk":"@@ -38,46 +39,63 @@ class Stack[A] protected (array: Array[AnyRef], start: Int, end: Int)\n     * @param elem\n     * @return\n     */\n-  def push(elem: A): this.type = this += elem\n+  def push(elem: A): this.type = prepend(elem)\n \n   /** Push two or more elements onto the stack. The last element\n     *  of the sequence will be on top of the new stack.\n     *\n     *  @param   elems      the element sequence.\n     *  @return the stack with the new elements on top.\n     */\n-  def push(elem1: A, elem2: A, elems: A*): this.type = push(elem1).push(elem2).pushAll(elems.toStrawman)\n+  def push(elem1: A, elem2: A, elems: A*): this.type = {\n+    val k = elems.toStrawman.knownSize\n+    ensureSize(length + (if(k >= 0) k + 2 else 3))\n+    prepend(elem1).prepend(elem2).pushAll(elems.toStrawman)\n+  }\n \n   /** Push all elements in the given traversable object onto the stack. The\n     *  last element in the traversable object will be on top of the new stack.\n     *\n     *  @param elems the traversable object.\n     *  @return the stack with the new elements on top.\n     */\n-  def pushAll(elems: strawman.collection.IterableOnce[A]): this.type = this ++= elems\n+  def pushAll(elems: strawman.collection.IterableOnce[A]): this.type =\n+    prependAll(elems match {\n+      case it: strawman.collection.Seq[A] => it.view.reverse\n+      case it => IndexedSeq.from(it).view.reverse\n+    })","path":"collections/src/main/scala/strawman/collection/mutable/Stack.scala","position":47,"original_position":47,"commit_id":"d7427f00e8c80feb4c6901e968d74e13151a96ea","original_commit_id":"d7427f00e8c80feb4c6901e968d74e13151a96ea","user":{"login":"julienrf","id":332812,"avatar_url":"https://avatars2.githubusercontent.com/u/332812?v=4","gravatar_id":"","url":"https://api.github.com/users/julienrf","html_url":"https://github.com/julienrf","followers_url":"https://api.github.com/users/julienrf/followers","following_url":"https://api.github.com/users/julienrf/following{/other_user}","gists_url":"https://api.github.com/users/julienrf/gists{/gist_id}","starred_url":"https://api.github.com/users/julienrf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/julienrf/subscriptions","organizations_url":"https://api.github.com/users/julienrf/orgs","repos_url":"https://api.github.com/users/julienrf/repos","events_url":"https://api.github.com/users/julienrf/events{/privacy}","received_events_url":"https://api.github.com/users/julienrf/received_events","type":"User","site_admin":false},"body":"We see here that it’s less efficient to choose this order (pushed elements are prepended rather than appended). Is it specified somewhere that it should be done that way?","created_at":"2018-03-15T15:30:58Z","updated_at":"2018-03-15T15:31:12Z","html_url":"https://github.com/scala/collection-strawman/pull/514#discussion_r174826117","pull_request_url":"https://api.github.com/repos/scala/collection-strawman/pulls/514","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/scala/collection-strawman/pulls/comments/174826117"},"html":{"href":"https://github.com/scala/collection-strawman/pull/514#discussion_r174826117"},"pull_request":{"href":"https://api.github.com/repos/scala/collection-strawman/pulls/514"}}},"pull_request":{"url":"https://api.github.com/repos/scala/collection-strawman/pulls/514","id":174727899,"html_url":"https://github.com/scala/collection-strawman/pull/514","diff_url":"https://github.com/scala/collection-strawman/pull/514.diff","patch_url":"https://github.com/scala/collection-strawman/pull/514.patch","issue_url":"https://api.github.com/repos/scala/collection-strawman/issues/514","number":514,"state":"open","locked":false,"title":"More fixes from latest rebasing of Scala 2.13.x integration build","user":{"login":"szeiger","id":54262,"avatar_url":"https://avatars3.githubusercontent.com/u/54262?v=4","gravatar_id":"","url":"https://api.github.com/users/szeiger","html_url":"https://github.com/szeiger","followers_url":"https://api.github.com/users/szeiger/followers","following_url":"https://api.github.com/users/szeiger/following{/other_user}","gists_url":"https://api.github.com/users/szeiger/gists{/gist_id}","starred_url":"https://api.github.com/users/szeiger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szeiger/subscriptions","organizations_url":"https://api.github.com/users/szeiger/orgs","repos_url":"https://api.github.com/users/szeiger/repos","events_url":"https://api.github.com/users/szeiger/events{/privacy}","received_events_url":"https://api.github.com/users/szeiger/received_events","type":"User","site_admin":false},"body":"- Restore `IterableFactory.toBuildFrom` which was erroneously removed\r\n  in https://github.com/scala/collection-strawman/pull/495\r\n- Fix `ArrayOps.ReverseIterator`\r\n- More explicit syntax in `AnyRefMap.collect` implementation to make it\r\n  compile with and without Predef\r\n- Add a deprecated `front` method to `mutable.Queue`\r\n","created_at":"2018-03-13T17:06:03Z","updated_at":"2018-03-15T15:31:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4238fc90d394ee45ef96e19affef2617ca8edbe7","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/scala/collection-strawman/pulls/514/commits","review_comments_url":"https://api.github.com/repos/scala/collection-strawman/pulls/514/comments","review_comment_url":"https://api.github.com/repos/scala/collection-strawman/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scala/collection-strawman/issues/514/comments","statuses_url":"https://api.github.com/repos/scala/collection-strawman/statuses/d7427f00e8c80feb4c6901e968d74e13151a96ea","head":{"label":"scala:wip/compat4","ref":"wip/compat4","sha":"d7427f00e8c80feb4c6901e968d74e13151a96ea","user":{"login":"scala","id":57059,"avatar_url":"https://avatars2.githubusercontent.com/u/57059?v=4","gravatar_id":"","url":"https://api.github.com/users/scala","html_url":"https://github.com/scala","followers_url":"https://api.github.com/users/scala/followers","following_url":"https://api.github.com/users/scala/following{/other_user}","gists_url":"https://api.github.com/users/scala/gists{/gist_id}","starred_url":"https://api.github.com/users/scala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scala/subscriptions","organizations_url":"https://api.github.com/users/scala/orgs","repos_url":"https://api.github.com/users/scala/repos","events_url":"https://api.github.com/users/scala/events{/privacy}","received_events_url":"https://api.github.com/users/scala/received_events","type":"Organization","site_admin":false},"repo":{"id":69596738,"name":"collection-strawman","full_name":"scala/collection-strawman","owner":{"login":"scala","id":57059,"avatar_url":"https://avatars2.githubusercontent.com/u/57059?v=4","gravatar_id":"","url":"https://api.github.com/users/scala","html_url":"https://github.com/scala","followers_url":"https://api.github.com/users/scala/followers","following_url":"https://api.github.com/users/scala/following{/other_user}","gists_url":"https://api.github.com/users/scala/gists{/gist_id}","starred_url":"https://api.github.com/users/scala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scala/subscriptions","organizations_url":"https://api.github.com/users/scala/orgs","repos_url":"https://api.github.com/users/scala/repos","events_url":"https://api.github.com/users/scala/events{/privacy}","received_events_url":"https://api.github.com/users/scala/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scala/collection-strawman","description":"Implementation of the new Scala 2.13 Collections","fork":false,"url":"https://api.github.com/repos/scala/collection-strawman","forks_url":"https://api.github.com/repos/scala/collection-strawman/forks","keys_url":"https://api.github.com/repos/scala/collection-strawman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scala/collection-strawman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scala/collection-strawman/teams","hooks_url":"https://api.github.com/repos/scala/collection-strawman/hooks","issue_events_url":"https://api.github.com/repos/scala/collection-strawman/issues/events{/number}","events_url":"https://api.github.com/repos/scala/collection-strawman/events","assignees_url":"https://api.github.com/repos/scala/collection-strawman/assignees{/user}","branches_url":"https://api.github.com/repos/scala/collection-strawman/branches{/branch}","tags_url":"https://api.github.com/repos/scala/collection-strawman/tags","blobs_url":"https://api.github.com/repos/scala/collection-strawman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scala/collection-strawman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scala/collection-strawman/git/refs{/sha}","trees_url":"https://api.github.com/repos/scala/collection-strawman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scala/collection-strawman/statuses/{sha}","languages_url":"https://api.github.com/repos/scala/collection-strawman/languages","stargazers_url":"https://api.github.com/repos/scala/collection-strawman/stargazers","contributors_url":"https://api.github.com/repos/scala/collection-strawman/contributors","subscribers_url":"https://api.github.com/repos/scala/collection-strawman/subscribers","subscription_url":"https://api.github.com/repos/scala/collection-strawman/subscription","commits_url":"https://api.github.com/repos/scala/collection-strawman/commits{/sha}","git_commits_url":"https://api.github.com/repos/scala/collection-strawman/git/commits{/sha}","comments_url":"https://api.github.com/repos/scala/collection-strawman/comments{/number}","issue_comment_url":"https://api.github.com/repos/scala/collection-strawman/issues/comments{/number}","contents_url":"https://api.github.com/repos/scala/collection-strawman/contents/{+path}","compare_url":"https://api.github.com/repos/scala/collection-strawman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scala/collection-strawman/merges","archive_url":"https://api.github.com/repos/scala/collection-strawman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scala/collection-strawman/downloads","issues_url":"https://api.github.com/repos/scala/collection-strawman/issues{/number}","pulls_url":"https://api.github.com/repos/scala/collection-strawman/pulls{/number}","milestones_url":"https://api.github.com/repos/scala/collection-strawman/milestones{/number}","notifications_url":"https://api.github.com/repos/scala/collection-strawman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scala/collection-strawman/labels{/name}","releases_url":"https://api.github.com/repos/scala/collection-strawman/releases{/id}","deployments_url":"https://api.github.com/repos/scala/collection-strawman/deployments","created_at":"2016-09-29T18:38:21Z","updated_at":"2018-03-15T08:03:34Z","pushed_at":"2018-03-15T15:12:53Z","git_url":"git://github.com/scala/collection-strawman.git","ssh_url":"git@github.com:scala/collection-strawman.git","clone_url":"https://github.com/scala/collection-strawman.git","svn_url":"https://github.com/scala/collection-strawman","homepage":"","size":2048,"stargazers_count":185,"watchers_count":185,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":64,"mirror_url":null,"archived":false,"open_issues_count":78,"license":null,"forks":64,"open_issues":78,"watchers":185,"default_branch":"master"}},"base":{"label":"scala:master","ref":"master","sha":"3c0367097411b32bed01ff9c659063d8d13028a6","user":{"login":"scala","id":57059,"avatar_url":"https://avatars2.githubusercontent.com/u/57059?v=4","gravatar_id":"","url":"https://api.github.com/users/scala","html_url":"https://github.com/scala","followers_url":"https://api.github.com/users/scala/followers","following_url":"https://api.github.com/users/scala/following{/other_user}","gists_url":"https://api.github.com/users/scala/gists{/gist_id}","starred_url":"https://api.github.com/users/scala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scala/subscriptions","organizations_url":"https://api.github.com/users/scala/orgs","repos_url":"https://api.github.com/users/scala/repos","events_url":"https://api.github.com/users/scala/events{/privacy}","received_events_url":"https://api.github.com/users/scala/received_events","type":"Organization","site_admin":false},"repo":{"id":69596738,"name":"collection-strawman","full_name":"scala/collection-strawman","owner":{"login":"scala","id":57059,"avatar_url":"https://avatars2.githubusercontent.com/u/57059?v=4","gravatar_id":"","url":"https://api.github.com/users/scala","html_url":"https://github.com/scala","followers_url":"https://api.github.com/users/scala/followers","following_url":"https://api.github.com/users/scala/following{/other_user}","gists_url":"https://api.github.com/users/scala/gists{/gist_id}","starred_url":"https://api.github.com/users/scala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scala/subscriptions","organizations_url":"https://api.github.com/users/scala/orgs","repos_url":"https://api.github.com/users/scala/repos","events_url":"https://api.github.com/users/scala/events{/privacy}","received_events_url":"https://api.github.com/users/scala/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scala/collection-strawman","description":"Implementation of the new Scala 2.13 Collections","fork":false,"url":"https://api.github.com/repos/scala/collection-strawman","forks_url":"https://api.github.com/repos/scala/collection-strawman/forks","keys_url":"https://api.github.com/repos/scala/collection-strawman/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scala/collection-strawman/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scala/collection-strawman/teams","hooks_url":"https://api.github.com/repos/scala/collection-strawman/hooks","issue_events_url":"https://api.github.com/repos/scala/collection-strawman/issues/events{/number}","events_url":"https://api.github.com/repos/scala/collection-strawman/events","assignees_url":"https://api.github.com/repos/scala/collection-strawman/assignees{/user}","branches_url":"https://api.github.com/repos/scala/collection-strawman/branches{/branch}","tags_url":"https://api.github.com/repos/scala/collection-strawman/tags","blobs_url":"https://api.github.com/repos/scala/collection-strawman/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scala/collection-strawman/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scala/collection-strawman/git/refs{/sha}","trees_url":"https://api.github.com/repos/scala/collection-strawman/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scala/collection-strawman/statuses/{sha}","languages_url":"https://api.github.com/repos/scala/collection-strawman/languages","stargazers_url":"https://api.github.com/repos/scala/collection-strawman/stargazers","contributors_url":"https://api.github.com/repos/scala/collection-strawman/contributors","subscribers_url":"https://api.github.com/repos/scala/collection-strawman/subscribers","subscription_url":"https://api.github.com/repos/scala/collection-strawman/subscription","commits_url":"https://api.github.com/repos/scala/collection-strawman/commits{/sha}","git_commits_url":"https://api.github.com/repos/scala/collection-strawman/git/commits{/sha}","comments_url":"https://api.github.com/repos/scala/collection-strawman/comments{/number}","issue_comment_url":"https://api.github.com/repos/scala/collection-strawman/issues/comments{/number}","contents_url":"https://api.github.com/repos/scala/collection-strawman/contents/{+path}","compare_url":"https://api.github.com/repos/scala/collection-strawman/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scala/collection-strawman/merges","archive_url":"https://api.github.com/repos/scala/collection-strawman/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scala/collection-strawman/downloads","issues_url":"https://api.github.com/repos/scala/collection-strawman/issues{/number}","pulls_url":"https://api.github.com/repos/scala/collection-strawman/pulls{/number}","milestones_url":"https://api.github.com/repos/scala/collection-strawman/milestones{/number}","notifications_url":"https://api.github.com/repos/scala/collection-strawman/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scala/collection-strawman/labels{/name}","releases_url":"https://api.github.com/repos/scala/collection-strawman/releases{/id}","deployments_url":"https://api.github.com/repos/scala/collection-strawman/deployments","created_at":"2016-09-29T18:38:21Z","updated_at":"2018-03-15T08:03:34Z","pushed_at":"2018-03-15T15:12:53Z","git_url":"git://github.com/scala/collection-strawman.git","ssh_url":"git@github.com:scala/collection-strawman.git","clone_url":"https://github.com/scala/collection-strawman.git","svn_url":"https://github.com/scala/collection-strawman","homepage":"","size":2048,"stargazers_count":185,"watchers_count":185,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":64,"mirror_url":null,"archived":false,"open_issues_count":78,"license":null,"forks":64,"open_issues":78,"watchers":185,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scala/collection-strawman/pulls/514"},"html":{"href":"https://github.com/scala/collection-strawman/pull/514"},"issue":{"href":"https://api.github.com/repos/scala/collection-strawman/issues/514"},"comments":{"href":"https://api.github.com/repos/scala/collection-strawman/issues/514/comments"},"review_comments":{"href":"https://api.github.com/repos/scala/collection-strawman/pulls/514/comments"},"review_comment":{"href":"https://api.github.com/repos/scala/collection-strawman/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scala/collection-strawman/pulls/514/commits"},"statuses":{"href":"https://api.github.com/repos/scala/collection-strawman/statuses/d7427f00e8c80feb4c6901e968d74e13151a96ea"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"julienrf"}}