From 5d48ab8c28925f892e8e7f432f7d2b78c86e95c5 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Tue, 11 Jul 2006 06:13:32 +0000 Subject: Performance improvement hackathon: improve process comparison routines, disable useless code in release builds such as runtime type-checking on dynamic data structures and process fields that are not being computed, faster(?) method for verifying the process owner (still need to ensure correctness), don't destroy and create process objects for hidden kernel threads over and over. Phew. I shouldn't be doing all this today, but I could not resist. --- String.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'String.c') diff --git a/String.c b/String.c index 00cd4f2c..e862bff5 100644 --- a/String.c +++ b/String.c @@ -14,6 +14,10 @@ in the source distribution for its full text. #include "debug.h" +/*{ +#define String_startsWith(s, match) (strstr((s), (match)) == (s)) +}*/ + inline void String_delete(char* s) { free(s); } @@ -102,10 +106,6 @@ inline int String_eq(char* s1, char* s2) { return (strcmp(s1, s2) == 0); } -inline int String_startsWith(char* s, char* match) { - return (strstr(s, match) == s); -} - char** String_split(char* s, char sep) { const int rate = 10; char** out = (char**) malloc(sizeof(char*) * rate); -- cgit v1.2.3