mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Runtime: Check for SpecialProtocol::AnyObject instead of strcmp'ing the mangled protocol name.
Swift SVN r26500
This commit is contained in:
@@ -463,7 +463,7 @@ static bool _conformsToProtocol(const OpaqueValue *value,
|
||||
const WitnessTable **conformance) {
|
||||
// Handle AnyObject directly.
|
||||
// FIXME: strcmp here is horribly slow.
|
||||
if (strcmp(protocol->Name, "_TtPSs9AnyObject_") == 0) {
|
||||
if (protocol->Flags.getSpecialProtocol() == SpecialProtocol::AnyObject) {
|
||||
switch (type->getKind()) {
|
||||
case MetadataKind::Class:
|
||||
case MetadataKind::ObjCClassWrapper:
|
||||
|
||||
Reference in New Issue
Block a user