]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[OPTIM] halog: remove support for tab delimiters in input data
authorWilly Tarreau <w@1wt.eu>
Sun, 10 Jul 2011 20:11:17 +0000 (22:11 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 11 Jul 2011 04:48:04 +0000 (06:48 +0200)
Haproxy does not use tabs when sending logs, and checking for them
wastes no less than 4% of CPU cycles. Better get rid of these tests.

contrib/halog/halog.c

index 401c0ee7954d14e3831ac76f2d91046567686407..120521a2860e8859da917270b0e73fb3467757c5 100644 (file)
@@ -137,7 +137,7 @@ const char *field_stop(const char *p)
                c = *(p++);
                if (c > ' ')
                        continue;
-               if (c == ' ' || c == '\t' || c == 0)
+               if (c == ' ' || c == 0)
                        break;
        }
        return p - 1;
@@ -156,7 +156,7 @@ const char *field_start(const char *p, int field)
                        c = *p;
                        if (c > ' ')
                                break;
-                       if (c == ' ' || c == '\t')
+                       if (c == ' ')
                                goto next;
                        if (!c) /* end of line */
                                return p;
@@ -176,7 +176,7 @@ const char *field_start(const char *p, int field)
                        c = *(p++);
                        if (c > ' ')
                                continue;
-                       if (c == ' ' || c == '\t')
+                       if (c == ' ')
                                break;
                        if (c == '\0')
                                return p;
@@ -1088,7 +1088,7 @@ void filter_count_url(const char *accept_field, const char *time_field, struct t
        /* stop at end of field or first ';' or '?', takes avg 64 ns per line */
        e = b;
        do {
-               if (*e == ' ' || *e == '?' || *e == ';' || *e == '\t') {
+               if (*e == ' ' || *e == '?' || *e == ';') {
                        *(char *)e = 0;
                        break;
                }