Skip to content

Commit

Permalink
Improve Empty performance
Browse files Browse the repository at this point in the history
  • Loading branch information
KaQuMiQ authored Jun 16, 2023
1 parent bb7df4b commit 80dfb77
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Sources/MQ/Utilities/EmptyInstantiable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,47 +10,55 @@ public protocol EmptyInstantiable {
// swift-format-ignore: AllPublicDeclarationsHaveDocumentation
extension StaticString: EmptyInstantiable {

@inline(__always) @_transparent @_semantics("constant_evaluable")
public static var empty: Self { .init() }
}

// swift-format-ignore: AllPublicDeclarationsHaveDocumentation
extension String: EmptyInstantiable {

@inline(__always) @_transparent @_semantics("constant_evaluable")
public static var empty: Self { .init() }
}

// swift-format-ignore: AllPublicDeclarationsHaveDocumentation
extension Substring: EmptyInstantiable {

@inline(__always) @_transparent @_semantics("constant_evaluable")
public static var empty: Self { .init() }
}

// swift-format-ignore: AllPublicDeclarationsHaveDocumentation
extension Set: EmptyInstantiable {

@inline(__always) @_transparent @_semantics("constant_evaluable")
public static var empty: Self { .init() }
}

// swift-format-ignore: AllPublicDeclarationsHaveDocumentation
extension Array: EmptyInstantiable {

@inline(__always) @_transparent @_semantics("constant_evaluable")
public static var empty: Self { .init() }
}

// swift-format-ignore: AllPublicDeclarationsHaveDocumentation
extension ArraySlice: EmptyInstantiable {

@inline(__always) @_transparent @_semantics("constant_evaluable")
public static var empty: Self { .init() }
}

// swift-format-ignore: AllPublicDeclarationsHaveDocumentation
extension KeyValuePairs: EmptyInstantiable {

@inline(__always) @_transparent @_semantics("constant_evaluable")
public static var empty: Self { .init() }
}

// swift-format-ignore: AllPublicDeclarationsHaveDocumentation
extension Dictionary: EmptyInstantiable {

@inline(__always) @_transparent @_semantics("constant_evaluable")
public static var empty: Self { .init() }
}

0 comments on commit 80dfb77

Please sign in to comment.