Mark some more conversion functions as @readonly.

On -Ounchecked we are now able to zap this expression (from Richards):
  UnicodeScalar(UInt32(2)+"0".value)

However, on -O we still check for overflow and actually need to construct the string.



Swift SVN r20856
This commit is contained in:
Nadav Rotem
2014-07-31 22:15:36 +00:00
parent 40111a461a
commit 08e5bff61b
4 changed files with 10 additions and 6 deletions

View File

@@ -62,6 +62,7 @@ extension String {
}
extension String : _BuiltinExtendedGraphemeClusterLiteralConvertible {
@semantics("readonly")
public
static func _convertFromBuiltinExtendedGraphemeClusterLiteral(
start: Builtin.RawPointer,