diff options
author | nicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-15 18:24:27 +0000 |
---|---|---|
committer | nicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-15 18:24:27 +0000 |
commit | 8612dc73c5c08ed11b9d42cb9cbcb4d4abaf53b4 (patch) | |
tree | 6404e56954993f5feee47c733780ccc60be5b419 /libobjc/protocols.c | |
parent | e1dbac0b98eaf469e5cd15354faa884032a49607 (diff) | |
download | gcc-8612dc73c5c08ed11b9d42cb9cbcb4d4abaf53b4.tar.gz |
In libobjc/:
2010-10-15 Nicola Pero <nicola.pero@meta-innovation.com>
* Protocol.m: Include objc/runtime.h and
objc-private/module-abi-8.h instead of objc/objc-api.h. Do not
repeat Protocol's instance variables.
(struct objc_method_description_list): Do not define here.
([-conformsTo:]): Reimplemented on top of protocol_conformsTo().
([descriptionForInstanceMethod:]): Use sel_isEqual() to compare
selectors directly instead of getting names and then using strcmp.
([descriptionForClassMethod:]): Same change.
([-isEqual:]): Reimplemented on top of protocol_isEqual().
* protocols.c (protocol_getMethodDescription): Use sel_isEqual()
to compare selectors directly instead of getting names and then
using strcmp.
* objc/Protocol.h: Updated comments.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165517 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libobjc/protocols.c')
-rw-r--r-- | libobjc/protocols.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libobjc/protocols.c b/libobjc/protocols.c index d23d42d8f82..421e566e912 100644 --- a/libobjc/protocols.c +++ b/libobjc/protocols.c @@ -358,7 +358,6 @@ struct objc_method_description protocol_getMethodDescription (Protocol *protocol BOOL instanceMethod) { struct objc_method_description no_result = { NULL, NULL }; - const char* selector_name; struct objc_method_description_list *methods; int i; @@ -372,8 +371,6 @@ struct objc_method_description protocol_getMethodDescription (Protocol *protocol if (protocol->class_pointer != objc_lookupClass ("Protocol")) return no_result; - selector_name = sel_getName (selector); - if (instanceMethod) methods = ((struct objc_protocol *)protocol)->instance_methods; else @@ -383,8 +380,12 @@ struct objc_method_description protocol_getMethodDescription (Protocol *protocol { for (i = 0; i < methods->count; i++) { + if (sel_isEqual (methods->list[i].name, selector)) + return methods->list[i]; + /* if (strcmp (sel_getName (methods->list[i].name), selector_name) == 0) return methods->list[i]; + */ } } |