<commit_before>//===--- Join.swift - Protocol and Algorithm for concatenation ------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//

/// This protocol is an implementation detail of `ExtensibleCollectionType`; do
/// not use it directly.
///
/// Its requirements are inherited by `ExtensibleCollectionType` and thus must
/// be satisfied by types conforming to that protocol.
public protocol _ExtensibleCollectionType : CollectionType {
  /// Create an empty instance
  init()

  /// A non-binding request to ensure `n` elements of available storage.
  ///
  /// This works as an optimization to avoid multiple reallocations of
  /// linear data structures like `Array`.  Conforming types may
  /// reserve more than `n`, exactly `n`, less than `n` elements of
  /// storage, or even ignore the request completely.
  mutating func reserveCapacity(n: Index.Distance)

  /*
  The 'extend' requirement should be an operator, but the compiler crashes:

  <rdar://problem/16566712> Dependent type should have been substituted by Sema
  or SILGen

  func +=<
    S : SequenceType
    where S.Generator.Element == Self.Generator.Element
  >(inout _: Self, _: S)
  */

  /// Append `x` to `self`.
  ///
  /// Applying `successor()` to the index of the new element yields
  /// `self.endIndex`.
  ///
  /// Complexity: amortized O(1).
  mutating func append(x: Self.Generator.Element)

  /// Append the elements of `newElements` to `self`.
  ///
  /// Complexity: O(*length of result*) 
  /// 
  /// A possible implementation::
  ///
  ///   reserveCapacity(count(self) + underestimateCount(newElements))
  ///   for x in newElements {
  ///     newElements.append(x)
  ///   }
  mutating func extend<
      S : SequenceType
      where S.Generator.Element == Self.Generator.Element
  >(newElements: S)<commit_msg>stdlib: fix comment for ExtensibleCollectionType.extend()<commit_after>//===--- Join.swift - Protocol and Algorithm for concatenation ------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//

/// This protocol is an implementation detail of `ExtensibleCollectionType`; do
/// not use it directly.
///
/// Its requirements are inherited by `ExtensibleCollectionType` and thus must
/// be satisfied by types conforming to that protocol.
public protocol _ExtensibleCollectionType : CollectionType {
  /// Create an empty instance
  init()

  /// A non-binding request to ensure `n` elements of available storage.
  ///
  /// This works as an optimization to avoid multiple reallocations of
  /// linear data structures like `Array`.  Conforming types may
  /// reserve more than `n`, exactly `n`, less than `n` elements of
  /// storage, or even ignore the request completely.
  mutating func reserveCapacity(n: Index.Distance)

  /*
  The 'extend' requirement should be an operator, but the compiler crashes:

  <rdar://problem/16566712> Dependent type should have been substituted by Sema
  or SILGen

  func +=<
    S : SequenceType
    where S.Generator.Element == Self.Generator.Element
  >(inout _: Self, _: S)
  */

  /// Append `x` to `self`.
  ///
  /// Applying `successor()` to the index of the new element yields
  /// `self.endIndex`.
  ///
  /// Complexity: amortized O(1).
  mutating func append(x: Self.Generator.Element)

  /// Append the elements of `newElements` to `self`.
  ///
  /// Complexity: O(*length of result*) 
  /// 
  /// A possible implementation::
  ///
  ///   reserveCapacity(count(self) + underestimateCount(newElements))
  ///   for x in newElements {
  ///     self.append(x)
  ///   }
  mutating func extend<
      S : SequenceType
      where S.Generator.Element == Self.Generator.Element
  >(newElements: S)
{'fraction_non_alphanumeric': 0.158308972340904, 'fraction_numerical': 0.00854508657521925, 'mean_word_length': 2.5245641838351824, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5769952', 'n_tokens_mistral': 1253, 'n_tokens_neox': 1169, 'n_words': 453}