File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
trunk/stdlib/public/Darwin/Foundation Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 76e02b6b4413b47c3c60ec035727b5d50bc97651
2
+ refs/heads/master: 6e4aa2491ceac93132a12ebdbc426742618bd680
3
3
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
4
4
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
5
5
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea
Original file line number Diff line number Diff line change @@ -800,9 +800,14 @@ extension StringProtocol where Index == String.Index {
800
800
using encoding: String . Encoding ,
801
801
allowLossyConversion: Bool = false
802
802
) -> Data ? {
803
- return _ns. data (
804
- using: encoding. rawValue,
805
- allowLossyConversion: allowLossyConversion)
803
+ switch encoding {
804
+ case . utf8:
805
+ return Data ( self . utf8)
806
+ default :
807
+ return _ns. data (
808
+ using: encoding. rawValue,
809
+ allowLossyConversion: allowLossyConversion)
810
+ }
806
811
}
807
812
808
813
// @property NSString* decomposedStringWithCanonicalMapping;
You can’t perform that action at this time.
0 commit comments