<commit_before>//===----------------------------------------------------------------------===//
//
// 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
//
//===----------------------------------------------------------------------===//


extension String {
  /// Construct an instance that is the concatenation of `sz` copies
  /// of `repeatedValue`
  public init(count sz: Int, repeatedValue c: Character) {
    let s = String(c)
    self = String(_storage: _StringBuffer(
        capacity: s._core.count * sz,
        initialSize: 0,
        elementWidth: s._core.elementWidth))
    for i in 0..<sz {
      self += s
    }
  }

  /// Construct an instance that is the concatenation of `sz` copies
  /// of `Character(repeatedValue)`
  public init(count: Int, repeatedValue c: UnicodeScalar) {
    self = String._fromWellFormedCodeUnitSequence(UTF32.self,
        input: Repeat(count: count, repeatedValue: c.value))
  }
  
  public var _lines : [String] {
    return _split("\n")
  }
  
  public func _split(separator: UnicodeScalar) -> [String] {
    var scalarSlices = Swift.split(unicodeScalars, { $0 == separator })
    return scalarSlices.map { String($0) }
  }

  /// `true` iff `self` contains no characters.
  public var isEmpty : Bool {
    return _core.count == 0
  }<commit_msg>stdlib: use 'count' for parameter name consistently<commit_after>//===----------------------------------------------------------------------===//
//
// 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
//
//===----------------------------------------------------------------------===//


extension String {
  /// Construct an instance that is the concatenation of `count` copies
  /// of `repeatedValue`
  public init(count: Int, repeatedValue c: Character) {
    let s = String(c)
    self = String(_storage: _StringBuffer(
        capacity: s._core.count * count,
        initialSize: 0,
        elementWidth: s._core.elementWidth))
    for i in 0..<count {
      self += s
    }
  }

  /// Construct an instance that is the concatenation of `count` copies
  /// of `Character(repeatedValue)`
  public init(count: Int, repeatedValue c: UnicodeScalar) {
    self = String._fromWellFormedCodeUnitSequence(UTF32.self,
        input: Repeat(count: count, repeatedValue: c.value))
  }
  
  public var _lines : [String] {
    return _split("\n")
  }
  
  public func _split(separator: UnicodeScalar) -> [String] {
    var scalarSlices = Swift.split(unicodeScalars, { $0 == separator })
    return scalarSlices.map { String($0) }
  }

  /// `true` iff `self` contains no characters.
  public var isEmpty : Bool {
    return _core.count == 0
  }
{'fraction_non_alphanumeric': 0.2019857275829972, 'fraction_numerical': 0.010549177784672665, 'mean_word_length': 2.142300194931774, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4015941', 'n_tokens_mistral': 936, 'n_tokens_neox': 869, 'n_words': 291}