mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
remove TODO
This commit is contained in:
@@ -20,11 +20,12 @@ template <typename T, typename Enable = void>
|
||||
struct Comparer;
|
||||
|
||||
template <typename T>
|
||||
struct Comparer<T, typename enable_if<IsString<T>::value>::type>
|
||||
: ComparerBase {
|
||||
T rhs; // TODO: store adapted string?
|
||||
struct Comparer<T, typename enable_if<IsString<T>::value>::type> : ComparerBase {
|
||||
T rhs;
|
||||
|
||||
explicit Comparer(T value) : rhs(value) {}
|
||||
explicit Comparer(T value)
|
||||
: rhs(value) {
|
||||
}
|
||||
|
||||
CompareResult visitString(const char * lhs, size_t n) {
|
||||
int i = stringCompare(adaptString(rhs), adaptString(lhs, n));
|
||||
@@ -45,12 +46,12 @@ struct Comparer<T, typename enable_if<IsString<T>::value>::type>
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct Comparer<T, typename enable_if<is_integral<T>::value ||
|
||||
is_floating_point<T>::value>::type>
|
||||
: ComparerBase {
|
||||
struct Comparer<T, typename enable_if<is_integral<T>::value || is_floating_point<T>::value>::type> : ComparerBase {
|
||||
T rhs;
|
||||
|
||||
explicit Comparer(T value) : rhs(value) {}
|
||||
explicit Comparer(T value)
|
||||
: rhs(value) {
|
||||
}
|
||||
|
||||
CompareResult visitFloat(JsonFloat lhs) {
|
||||
return arithmeticCompare(lhs, rhs);
|
||||
@@ -78,14 +79,18 @@ struct NullComparer : ComparerBase {
|
||||
#if ARDUINOJSON_HAS_NULLPTR
|
||||
template <>
|
||||
struct Comparer<decltype(nullptr), void> : NullComparer {
|
||||
explicit Comparer(decltype(nullptr)) : NullComparer() {}
|
||||
explicit Comparer(decltype(nullptr))
|
||||
: NullComparer() {
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
struct ArrayComparer : ComparerBase {
|
||||
const CollectionData * _rhs;
|
||||
|
||||
explicit ArrayComparer(const CollectionData& rhs) : _rhs(&rhs) {}
|
||||
explicit ArrayComparer(const CollectionData & rhs)
|
||||
: _rhs(&rhs) {
|
||||
}
|
||||
|
||||
CompareResult visitArray(const CollectionData & lhs) {
|
||||
if (JsonArrayConst(&lhs) == JsonArrayConst(_rhs))
|
||||
@@ -98,7 +103,9 @@ struct ArrayComparer : ComparerBase {
|
||||
struct ObjectComparer : ComparerBase {
|
||||
const CollectionData * _rhs;
|
||||
|
||||
explicit ObjectComparer(const CollectionData& rhs) : _rhs(&rhs) {}
|
||||
explicit ObjectComparer(const CollectionData & rhs)
|
||||
: _rhs(&rhs) {
|
||||
}
|
||||
|
||||
CompareResult visitObject(const CollectionData & lhs) {
|
||||
if (JsonObjectConst(&lhs) == JsonObjectConst(_rhs))
|
||||
@@ -113,7 +120,9 @@ struct RawComparer : ComparerBase {
|
||||
size_t _rhsSize;
|
||||
|
||||
explicit RawComparer(const char * rhsData, size_t rhsSize)
|
||||
: _rhsData(rhsData), _rhsSize(rhsSize) {}
|
||||
: _rhsData(rhsData)
|
||||
, _rhsSize(rhsSize) {
|
||||
}
|
||||
|
||||
CompareResult visitRawJson(const char * lhsData, size_t lhsSize) {
|
||||
size_t size = _rhsSize < lhsSize ? _rhsSize : lhsSize;
|
||||
@@ -130,7 +139,9 @@ struct RawComparer : ComparerBase {
|
||||
struct VariantComparer : ComparerBase {
|
||||
const VariantData * rhs;
|
||||
|
||||
explicit VariantComparer(const VariantData* value) : rhs(value) {}
|
||||
explicit VariantComparer(const VariantData * value)
|
||||
: rhs(value) {
|
||||
}
|
||||
|
||||
CompareResult visitArray(const CollectionData & lhs) {
|
||||
ArrayComparer comparer(lhs);
|
||||
@@ -193,11 +204,10 @@ struct VariantComparer : ComparerBase {
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct Comparer<
|
||||
T, typename enable_if<is_convertible<T, JsonVariantConst>::value>::type>
|
||||
: VariantComparer {
|
||||
struct Comparer<T, typename enable_if<is_convertible<T, JsonVariantConst>::value>::type> : VariantComparer {
|
||||
explicit Comparer(const T & value)
|
||||
: VariantComparer(VariantAttorney::getData(value)) {}
|
||||
: VariantComparer(VariantAttorney::getData(value)) {
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
|
||||
Reference in New Issue
Block a user