Explorar o código

Save a couple characters' allocation in esc_for_log

Florian Zumbiehl %!s(int64=15) %!d(string=hai) anos
pai
achega
426116113f
Modificáronse 2 ficheiros con 6 adicións e 0 borrados
  1. 3 0
      changes/less_alloc_for_esc
  2. 3 0
      src/common/util.c

+ 3 - 0
changes/less_alloc_for_esc

@@ -0,0 +1,3 @@
+ o Minor bugfixes
+   - Save a couple bytes in memory allocation every time we escape
+     certain characters in a string.  Patch from Florian Zumbiehl.

+ 3 - 0
src/common/util.c

@@ -940,6 +940,9 @@ esc_for_log(const char *s)
       case '\\':
       case '\"':
       case '\'':
+      case '\r':
+      case '\n':
+      case '\t':
         len += 2;
         break;
       default: