[llvm-commits] [llvm-gcc-4.0] r42381 - /llvm-gcc-4.0/trunk/gcc/objc/objc-act.c
Bill Wendling
isanbard at gmail.com
Wed Sep 26 15:11:38 PDT 2007
Author: void
Date: Wed Sep 26 17:11:38 2007
New Revision: 42381
URL: http://llvm.org/viewvc/llvm-project?rev=42381&view=rev
Log:
Instead of the expensive "strstr" check, just do a "strncmp".
Modified:
llvm-gcc-4.0/trunk/gcc/objc/objc-act.c
Modified: llvm-gcc-4.0/trunk/gcc/objc/objc-act.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/objc/objc-act.c?rev=42381&r1=42380&r2=42381&view=diff
==============================================================================
--- llvm-gcc-4.0/trunk/gcc/objc/objc-act.c (original)
+++ llvm-gcc-4.0/trunk/gcc/objc/objc-act.c Wed Sep 26 17:11:38 2007
@@ -11683,7 +11683,8 @@
bool
objc_is_protocol_reference (const char *name)
{
- return flag_objc_abi == 2 && strstr (name, "_OBJC_PROTOCOL_$_") != 0;
+ return flag_objc_abi == 2 && strlen (name) > 19 &&
+ strncmp (name, "\01L_OBJC_PROTOCOL_$_", 19) == 0;
}
#endif
/* APPLE LOCAL end - LLVM radar 5476262 */
More information about the llvm-commits
mailing list