From dcf8aaf89febf9364d3b44b11886f39e31f0d7b6 Mon Sep 17 00:00:00 2001 From: Matt Dowle Date: Thu, 14 Apr 2016 21:58:31 -0700 Subject: [PATCH] fwrite comment added only. #580 --- src/fwrite.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/fwrite.c b/src/fwrite.c index 6bfd0f5f7..de5f6ba18 100644 --- a/src/fwrite.c +++ b/src/fwrite.c @@ -15,7 +15,7 @@ #define WRITE write #define CLOSE close #endif - + static inline int maxStrLen(SEXP x, int na_len) { // The max nchar of any string in a column or factor level int max=na_len, nrow=length(x); @@ -23,6 +23,10 @@ static inline int maxStrLen(SEXP x, int na_len) { int l = LENGTH(STRING_ELT(x,i)); if (l>max) max=l; } + // TODO if(quote) count them here (we hopped already to get LENGTH), add that quote count to max + // exactly and remove the *(1+quote) later + // if there are no quotes present in any string in a column save in quotePresent[ncol] lookup + // and switch to memcpy when it's known no quotes are present to be escaped for that column return max; }