summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorAndrew Sidwell <andy@entai.co.uk>2008-08-11 04:13:22 +0000
committerAndrew Sidwell <andy@entai.co.uk>2008-08-11 04:13:22 +0000
commit7a388e8066a94775e3e744188e51ed86ed289c50 (patch)
tree90afc17c825b6f4546129f08d0d82b475ecd9bf0 /src/utils
parentbea1f361c83927831aa19cc136dca478cfb33f64 (diff)
downloadlibhubbub-7a388e8066a94775e3e744188e51ed86ed289c50.tar.gz
libhubbub-7a388e8066a94775e3e744188e51ed86ed289c50.tar.bz2
- Add N_ELEMENTS() macro globally rather than using sizeof(x) / sizeof(x[0]) everywhere
- In anticipation of interning tag names, make the big map of name->type store them in lowercase - Take advantage of the previous change to optimise away many calls to strlen svn path=/trunk/hubbub/; revision=5010
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/utils.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/utils/utils.h b/src/utils/utils.h
index a1e0230..d22a0eb 100644
--- a/src/utils/utils.h
+++ b/src/utils/utils.h
@@ -25,4 +25,7 @@
#define UNUSED(x) ((x)=(x))
#endif
+/* Useful for iterating over arrays */
+#define N_ELEMENTS(x) sizeof((x)) / sizeof((x)[0])
+
#endif