summaryrefslogtreecommitdiffstats
path: root/template.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2013-01-13 14:40:17 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2013-01-13 14:40:17 +0100
commit8339d54ddcbc93771fb6eb550cbf2d9ade988fb8 (patch)
treefbd8392c5d988350de75f2c0dc1ed8707ca203e2 /template.c
parent3d5c805ab6d4e9b8db0a948cda0f73340f2f326b (diff)
downloadrsyslog-8339d54ddcbc93771fb6eb550cbf2d9ade988fb8.tar.gz
rsyslog-8339d54ddcbc93771fb6eb550cbf2d9ade988fb8.tar.bz2
rsyslog-8339d54ddcbc93771fb6eb550cbf2d9ade988fb8.zip
optimize: do date() call in template processing only if actually needed
Diffstat (limited to 'template.c')
-rw-r--r--template.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/template.c b/template.c
index 35b16831..1ccb3752 100644
--- a/template.c
+++ b/template.c
@@ -376,38 +376,6 @@ finalize_it:
}
-/* Check if the template requires a date call (actually a cached
- * date structure). This currently is the case for the $NOW family
- * of properties.
- */
-int
-tplRequiresDateCall(struct template *pTpl)
-{
- struct templateEntry *pTpe;
- int r = 0;
-
- if(pTpl->subtree != NULL)
- goto done;
-
- for(pTpe = pTpl->pEntryRoot ; pTpe != NULL ; pTpe = pTpe->pNext) {
- switch(pTpe->data.field.propid) {
- case PROP_SYS_NOW:
- case PROP_SYS_YEAR:
- case PROP_SYS_MONTH:
- case PROP_SYS_DAY:
- case PROP_SYS_HOUR:
- case PROP_SYS_HHOUR:
- case PROP_SYS_QHOUR:
- case PROP_SYS_MINUTE:
- r = 1;
- goto done;
- default:break;
- }
- }
-done: return r;
-}
-
-
/* Helper to doEscape. This is called if doEscape
* runs out of memory allocating the escaped string.
* Then we are in trouble. We can