Index: src/runtime/protocol.m ================================================================== --- src/runtime/protocol.m +++ src/runtime/protocol.m @@ -29,20 +29,18 @@ { struct objc_protocol_list *pl; struct objc_category **cats; long i, j; - objc_global_mutex_lock(); - for (pl = cls->protocols; pl != NULL; pl = pl->next) { for (i = 0; i < pl->count; i++) { - if (!strcmp(pl->list[i]->name, p->name)) { - objc_global_mutex_unlock(); + if (!strcmp(pl->list[i]->name, p->name)) return YES; - } } } + + objc_global_mutex_lock(); if ((cats = objc_categories_for_class(cls)) == NULL) { objc_global_mutex_unlock(); return NO; }