Commit 57d3b8f
authored
Simplify string isAllWhitespace implementation (#235)
This patch is really very simple one, but I believe can be both a simplification on implementation and a perf improvement in the sense that as it is if we take for example as reference the implementation of [`trimmingCharacters`](https://github.com/apple/swift-corelibs-foundation/blob/34887cb2615e903cbe7ad428a538ee27be5a7d39/Sources/Foundation/NSString.swift#L1162) we note that it will do a lot extra work as allocating buffers or a whole new string maybe, when this only need a simple check that can exit early and also avoid those extra allocations.1 parent 88a4aa9 commit 57d3b8f
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
0 commit comments