Inline functions iptcc_is_builtin() and set_changed().
The two functions are obvious candidates for inlining.
Using gprof(1) shows that they actually affects performance.
Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
diff --git a/libiptc/libiptc.c b/libiptc/libiptc.c
index 29f671e..5afaf40 100644
--- a/libiptc/libiptc.c
+++ b/libiptc/libiptc.c
@@ -166,7 +166,7 @@
}
/* notify us that the ruleset has been modified by the user */
-static void
+static inline void
set_changed(TC_HANDLE_T h)
{
h->changed = 1;
@@ -268,7 +268,7 @@
**********************************************************************/
/* Is the given chain builtin (1) or user-defined (0) */
-static unsigned int iptcc_is_builtin(struct chain_head *c)
+static inline unsigned int iptcc_is_builtin(struct chain_head *c)
{
return (c->hooknum ? 1 : 0);
}