Skip to content
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
2 changes: 1 addition & 1 deletion Benchmark.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Differences within 1.00×–1.10× are treated as comparable performance.
| `equality/different` | 1.112 | 1.112 | **comparable performance** |
| `hash` | 7.545 | 7.557 | **comparable performance** |
| `init/empty` | 1.112 | 1.112 | **comparable performance** |
| `init/empty/string-literal` | 1.112 | 1.113 | **comparable performance** |
| `iterate/count` | 1.136 | 1.134 | **comparable performance** |
| `decode/15-byte` | 374 | 376 | **comparable performance** |
| `decode/16-byte` | 406 | 412 | **comparable performance** |
Expand All @@ -31,6 +32,5 @@ Differences within 1.00×–1.10× are treated as comparable performance.
| `encode/16-byte` | 367 | 394 | **comparable performance** |
| `init/16-byte` | 4.444 | 4.734 | **comparable performance** |
| `init/16-byte/string-literal` | 4.444 | 4.268 | **comparable performance** |
| `init/empty/string-literal` | 1.112 | 2.902| **2.60× slower** |
| `access/escaping/string` | 1.778 | 7.823 | **4.40× slower** |
| `access/string` | 1.112 | 7.172 | **6.45× slower** |
4 changes: 4 additions & 0 deletions Sources/InlineString/InlineString16.swift
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ extension InlineString16: ExpressibleByStringLiteral {
/// As a result, the final UTF-8 byte of the string cannot be in the range `0x00...0x0F`,
/// since those values are reserved for the length encoding.
public init(stringLiteral value: StringLiteralType) {
guard !value.isEmpty else {
self.init()
return
}
self.init(value)
}
}
Expand Down