summaryrefslogtreecommitdiff
path: root/zen/string_tools.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:22:36 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:22:36 +0200
commitecb1524f8da7901338b263384fed3c612f117b4c (patch)
treee7e06423fe27ea5ab45f27fc4b39ae597ba72490 /zen/string_tools.h
parent5.10 (diff)
downloadFreeFileSync-ecb1524f8da7901338b263384fed3c612f117b4c.tar.gz
FreeFileSync-ecb1524f8da7901338b263384fed3c612f117b4c.tar.bz2
FreeFileSync-ecb1524f8da7901338b263384fed3c612f117b4c.zip
5.11
Diffstat (limited to 'zen/string_tools.h')
-rw-r--r--zen/string_tools.h6
1 files changed, 3 insertions, 3 deletions
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<S>::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<CharType>)); -> this is NO assert situation
break;
}
bgstack15