From: Marcus Holland-Moritz Date: Thu, 23 Jun 2016 03:28:37 +0000 (-0700) Subject: Clean up Conv.cpp / Conv.h X-Git-Tag: 2016.07.26~127 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1186ac53ae1a7a169446c24c6f5d4fa1a06daa4d;p=folly.git Clean up Conv.cpp / Conv.h Summary: A bit of tidying up: - Remove unused digit1 / digit2 arrays - Remove unused MaxString - Move MaxString<> entirely to Conv.cpp, as it's not used in Conv.h - Extend anonymous namespace in Conv.cpp - Sort headers in Conv.h Reviewed By: yfeldblum Differential Revision: D3433767 fbshipit-source-id: 224a68f22505c0f2014ac376154d004eca1658a9 --- diff --git a/folly/Conv.cpp b/folly/Conv.cpp index 7c6afcff..c78ed498 100644 --- a/folly/Conv.cpp +++ b/folly/Conv.cpp @@ -19,14 +19,14 @@ namespace folly { namespace detail { -extern const char digit1[101] = - "00000000001111111111222222222233333333334444444444" - "55555555556666666666777777777788888888889999999999"; -extern const char digit2[101] = - "01234567890123456789012345678901234567890123456789" - "01234567890123456789012345678901234567890123456789"; - -template <> const char *const MaxString::value = "true"; +namespace { + +// Maximum value of number when represented as a string +template +struct MaxString { + static const char* const value; +}; + template <> const char *const MaxString::value = "255"; template <> const char *const MaxString::value = "65535"; template <> const char *const MaxString::value = "4294967295"; @@ -51,7 +51,6 @@ template <> const char *const MaxString<__uint128_t>::value = "340282366920938463463374607431768211455"; #endif -namespace { /* * Lookup tables that converts from a decimal character value to an integral * binary value, shifted by a decimal "shift" multiplier. diff --git a/folly/Conv.h b/folly/Conv.h index 450896a6..c0a350fe 100644 --- a/folly/Conv.h +++ b/folly/Conv.h @@ -23,24 +23,24 @@ #pragma once -#include -#include -#include -#include - -#include #include -#include +#include +#include #include +#include #include #include -#include +#include #include +#include -#include +#include +#include // V8 JavaScript implementation -// V8 JavaScript implementation -#include +#include +#include +#include +#include #define FOLLY_RANGE_CHECK_STRINGIZE(x) #x #define FOLLY_RANGE_CHECK_STRINGIZE2(x) FOLLY_RANGE_CHECK_STRINGIZE(x) @@ -981,10 +981,6 @@ namespace detail { return b; } - // Maximum value of number when represented as a string - template struct MaxString { - static const char*const value; - }; bool str_to_bool(StringPiece* src); float str_to_float(StringPiece* src);