summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2013-01-14 16:18:46 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2013-01-14 16:18:46 +0100
commit227d8faed2b70a4bf3bd9bb1d6078e5fdf845d3c (patch)
treeb5ee8b03a3d4ec983af26ccfea0e5ae7f2fd1156
parenta207e26fb8a4e8d125d3a3c508a8ea8096ab1f67 (diff)
downloadrsyslog-227d8faed2b70a4bf3bd9bb1d6078e5fdf845d3c.tar.gz
rsyslog-227d8faed2b70a4bf3bd9bb1d6078e5fdf845d3c.tar.bz2
rsyslog-227d8faed2b70a4bf3bd9bb1d6078e5fdf845d3c.zip
optimize: slight improvement due to isdigit() replacement
-rw-r--r--runtime/datetime.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/datetime.c b/runtime/datetime.c
index e839bf10..841ff625 100644
--- a/runtime/datetime.c
+++ b/runtime/datetime.c
@@ -182,12 +182,13 @@ getTime(time_t *ttSeconds)
* the method always returns zero.
* \retval The number parsed.
*/
-static int srSLMGParseInt32(uchar** ppsz, int *pLenStr)
+static inline int
+srSLMGParseInt32(uchar** ppsz, int *pLenStr)
{
register int i;
i = 0;
- while(*pLenStr > 0 && isdigit((int) **ppsz)) {
+ while(*pLenStr > 0 && **ppsz >= '0' && **ppsz <= '9') {
i = i * 10 + **ppsz - '0';
++(*ppsz);
--(*pLenStr);