Skip to content

Minor changes due to SE-0130: Replace String.init(repeating: Character, count: Int) by String.init(repeating: Sttring, count: Int) #477

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Foundation/NSDictionary.swift
Original file line number Diff line number Diff line change
Expand Up @@ -354,11 +354,11 @@ public class NSDictionary : NSObject, NSCopying, NSMutableCopying, NSSecureCodin
if level > 100 { return "..." }

var lines = [String]()
let indentation = String(repeating: Character(" "), count: level * 4)
let indentation = String(repeating: " ", count: level * 4)
lines.append(indentation + "{")

for key in self.allKeys {
var line = String(repeating: Character(" "), count: (level + 1) * 4)
var line = String(repeating: " ", count: (level + 1) * 4)

if key is NSArray {
line += (key as! NSArray).description(withLocale: locale, indent: level + 1)
Expand Down
12 changes: 6 additions & 6 deletions Tools/plutil/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ enum DisplayType {

extension Dictionary {
func display(_ indent: Int = 0, type: DisplayType = .Primary) {
let indentation = String(repeating: Character(" "), count: indent * 2)
let indentation = String(repeating: " ", count: indent * 2)
if type == .Primary || type == .Key {
print("\(indentation)[\n", terminator: "")
} else {
Expand All @@ -224,7 +224,7 @@ extension Dictionary {

extension Array {
func display(_ indent: Int = 0, type: DisplayType = .Primary) {
let indentation = String(repeating: Character(" "), count: indent * 2)
let indentation = String(repeating: " ", count: indent * 2)
if type == .Primary || type == .Key {
print("\(indentation)[\n", terminator: "")
} else {
Expand All @@ -242,7 +242,7 @@ extension Array {

extension String {
func display(_ indent: Int = 0, type: DisplayType = .Primary) {
let indentation = String(repeating: Character(" "), count: indent * 2)
let indentation = String(repeating: " ", count: indent * 2)
if type == .Primary {
print("\(indentation)\"\(self)\"\n", terminator: "")
}
Expand All @@ -256,7 +256,7 @@ extension String {

extension Bool {
func display(_ indent: Int = 0, type: DisplayType = .Primary) {
let indentation = String(repeating: Character(" "), count: indent * 2)
let indentation = String(repeating: " ", count: indent * 2)
if type == .Primary {
print("\(indentation)\"\(self ? "1" : "0")\"\n", terminator: "")
}
Expand All @@ -270,7 +270,7 @@ extension Bool {

extension NSNumber {
func display(_ indent: Int = 0, type: DisplayType = .Primary) {
let indentation = String(repeating: Character(" "), count: indent * 2)
let indentation = String(repeating: " ", count: indent * 2)
if type == .Primary {
print("\(indentation)\"\(self)\"\n", terminator: "")
}
Expand All @@ -284,7 +284,7 @@ extension NSNumber {

extension NSData {
func display(_ indent: Int = 0, type: DisplayType = .Primary) {
let indentation = String(repeating: Character(" "), count: indent * 2)
let indentation = String(repeating: " ", count: indent * 2)
if type == .Primary {
print("\(indentation)\"\(self)\"\n", terminator: "")
}
Expand Down