Commit 1186ac53 authored by Marcus Holland-Moritz's avatar Marcus Holland-Moritz Committed by Facebook Github Bot 3

Clean up Conv.cpp / Conv.h

Summary:
A bit of tidying up:

- Remove unused digit1 / digit2 arrays
- Remove unused MaxString<bool>
- 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
parent 47868e49
......@@ -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<bool>::value = "true";
namespace {
// Maximum value of number when represented as a string
template <class T>
struct MaxString {
static const char* const value;
};
template <> const char *const MaxString<uint8_t>::value = "255";
template <> const char *const MaxString<uint16_t>::value = "65535";
template <> const char *const MaxString<uint32_t>::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.
......
......@@ -23,24 +23,24 @@
#pragma once
#include <folly/FBString.h>
#include <folly/Likely.h>
#include <folly/Preprocessor.h>
#include <folly/Range.h>
#include <boost/implicit_cast.hpp>
#include <algorithm>
#include <type_traits>
#include <climits>
#include <cstddef>
#include <limits>
#include <stdexcept>
#include <string>
#include <tuple>
#include <stdexcept>
#include <type_traits>
#include <typeinfo>
#include <utility>
#include <limits.h>
#include <boost/implicit_cast.hpp>
#include <double-conversion/double-conversion.h> // V8 JavaScript implementation
// V8 JavaScript implementation
#include <double-conversion/double-conversion.h>
#include <folly/FBString.h>
#include <folly/Likely.h>
#include <folly/Preprocessor.h>
#include <folly/Range.h>
#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 <class T> struct MaxString {
static const char*const value;
};
bool str_to_bool(StringPiece* src);
float str_to_float(StringPiece* src);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment