diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:20:29 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:20:29 +0200 |
commit | b8f13e45be884dc12884ebe8f3dcd9eecb23a106 (patch) | |
tree | 22a6d8b96815d626061ff3e2d432c13078fca5c4 /zen/string_tools.h | |
parent | 5.4 (diff) | |
download | FreeFileSync-b8f13e45be884dc12884ebe8f3dcd9eecb23a106.tar.gz FreeFileSync-b8f13e45be884dc12884ebe8f3dcd9eecb23a106.tar.bz2 FreeFileSync-b8f13e45be884dc12884ebe8f3dcd9eecb23a106.zip |
5.5
Diffstat (limited to 'zen/string_tools.h')
-rw-r--r-- | zen/string_tools.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/zen/string_tools.h b/zen/string_tools.h index 04ba1eef..00eb50ee 100644 --- a/zen/string_tools.h +++ b/zen/string_tools.h @@ -90,7 +90,8 @@ bool isWhiteSpace(char ch) std::isspace(static_cast<unsigned char>(ch)) != 0; } -template <> inline bool isWhiteSpace(wchar_t ch) { return std::iswspace(ch) != 0; } +template <> inline +bool isWhiteSpace(wchar_t ch) { return std::iswspace(ch) != 0; } template <class Char> inline @@ -458,7 +459,7 @@ S formatInteger(Num n, bool hasMinus) assert(n >= 0); typedef typename GetCharType<S>::Type CharType; - const size_t bufferSize = 100; //sufficient for signed 256-bit numbers + const size_t bufferSize = 64; //sufficient for signed 128-bit numbers CharType buffer[bufferSize]; //it's generally faster to use a buffer than to rely on String::operator+=() (in)efficiency assert_static(2 + 5 * sizeof(n) / 2 <= bufferSize); //minimum required chars (+ sign char): 1 + ceil(ln_10 (256^sizeof(n))) =~ 1 + ceil(sizeof(n) * 2.4082) <= 2 + floor(sizeof(n) * 2.5) @@ -492,7 +493,6 @@ S numberTo(const Num& number, Int2Type<NUM_TYPE_UNSIGNED_INT>) //-------------------------------------------------------------------------------- - template <class Num, class S> inline Num stringTo(const S& str, Int2Type<NUM_TYPE_OTHER>) //default string to number conversion using streams: convenient, but SLOW { |