From ecb1524f8da7901338b263384fed3c612f117b4c Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Fri, 18 Apr 2014 17:22:36 +0200 Subject: 5.11 --- zen/string_tools.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'zen/string_tools.h') diff --git a/zen/string_tools.h b/zen/string_tools.h index c0bb1039..990c823a 100644 --- a/zen/string_tools.h +++ b/zen/string_tools.h @@ -468,8 +468,8 @@ S formatInteger(Num n, bool hasMinus) { assert(n >= 0); typedef typename GetCharType::Type CharType; - CharType buffer[2 + 5 * sizeof(Num) / 2]; //it's generally faster to use a buffer than to rely on String::operator+=() (in)efficiency - //minimum required chars (+ sign char): 1 + ceil(ln_10 (256^sizeof(n))) =~ 1 + ceil(sizeof(n) * 2.4082) < 2 + floor(sizeof(n) * 2.5) + CharType buffer[2 + sizeof(Num) * 5 / 2]; //it's generally faster to use a buffer than to rely on String::operator+=() (in)efficiency + //required chars (+ sign char): 1 + ceil(ln_10 (256^sizeof(n))) =~ 1 + ceil(sizeof(n) * 2.4082) < 2 + floor(sizeof(n) * 2.5) auto iter = std::end(buffer); do @@ -556,7 +556,7 @@ Num extractInteger(const S& str, bool& hasMinusSign) //very fast conversion to i } else { - //rest of string should contain whitespace only + //rest of string should contain whitespace only, it's NOT a bug if there is some! //assert(std::all_of(iter, last, &isWhiteSpace)); -> this is NO assert situation break; } -- cgit