summaryrefslogtreecommitdiff
path: root/dep.h
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2013-06-22 00:22:08 -0400
committerPaul Smith <psmith@gnu.org>2013-06-22 00:22:08 -0400
commite952841ff3506bf69e61202e5870c24b4b0992d4 (patch)
tree74ae34c9306f5dde33e258c4181215ee04d4203f /dep.h
parentbfe9aeba925568121373ca264ac32cf3bb86814d (diff)
downloadmake-e952841ff3506bf69e61202e5870c24b4b0992d4.tar.gz
Create a character map to use for locating stop-points in strings.
In various places we were passing flags and characters to compare, then using complex conditionals to see where to stop in string searches. Performance numbers reveal that we were spending as much as 23% of our processing time in these functions, most of it in the comparison lines. Instead create a character map and use a single bitwise comparison to determine if this is any one of the stop characters.
Diffstat (limited to 'dep.h')
-rw-r--r--dep.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/dep.h b/dep.h
index d1d3bbbf..a7c74a1e 100644
--- a/dep.h
+++ b/dep.h
@@ -53,13 +53,12 @@ struct nameseq
const char *name;
};
-
-#define PARSEFS_NONE (0x0000)
-#define PARSEFS_NOSTRIP (0x0001)
-#define PARSEFS_NOAR (0x0002)
-#define PARSEFS_NOGLOB (0x0004)
-#define PARSEFS_EXISTS (0x0008)
-#define PARSEFS_NOCACHE (0x0010)
+#define PARSEFS_NONE 0x0000
+#define PARSEFS_NOSTRIP 0x0001
+#define PARSEFS_NOAR 0x0002
+#define PARSEFS_NOGLOB 0x0004
+#define PARSEFS_EXISTS 0x0008
+#define PARSEFS_NOCACHE 0x0010
#define PARSE_FILE_SEQ(_s,_t,_c,_p,_f) \
(_t *)parse_file_seq ((_s),sizeof (_t),(_c),(_p),(_f))
@@ -68,7 +67,7 @@ struct nameseq
void *parse_file_seq ();
#else
void *parse_file_seq (char **stringp, unsigned int size,
- int stopchar, const char *prefix, int flags);
+ int stopmap, const char *prefix, int flags);
#endif
char *tilde_expand (const char *name);