mirror of
https://github.com/tristanpenman/valijson.git
synced 2024-12-13 10:32:58 +01:00
Fixed validation_visitor to work with adaptors that only support the
forward_iterator_tag for array value iterators.
This commit is contained in:
parent
2acde8ec54
commit
9e5b479b95
@ -1208,8 +1208,10 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t array_size = m_target.getArraySize();
|
||||||
|
|
||||||
// Empty arrays are always valid
|
// Empty arrays are always valid
|
||||||
if (m_target.getArraySize() == 0) {
|
if (array_size == 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1217,10 +1219,9 @@ public:
|
|||||||
|
|
||||||
const typename AdapterType::Array targetArray = m_target.asArray();
|
const typename AdapterType::Array targetArray = m_target.asArray();
|
||||||
const typename AdapterType::Array::const_iterator end = targetArray.end();
|
const typename AdapterType::Array::const_iterator end = targetArray.end();
|
||||||
const typename AdapterType::Array::const_iterator secondLast = --targetArray.end();
|
|
||||||
unsigned int outerIndex = 0;
|
|
||||||
typename AdapterType::Array::const_iterator outerItr = targetArray.begin();
|
typename AdapterType::Array::const_iterator outerItr = targetArray.begin();
|
||||||
for (; outerItr != secondLast; ++outerItr) {
|
for (unsigned int outerIndex = 0; outerIndex < array_size - 1 /*outerItr != secondLast*/; ++outerItr) {
|
||||||
unsigned int innerIndex = outerIndex + 1;
|
unsigned int innerIndex = outerIndex + 1;
|
||||||
typename AdapterType::Array::const_iterator innerItr(outerItr);
|
typename AdapterType::Array::const_iterator innerItr(outerItr);
|
||||||
for (++innerItr; innerItr != end; ++innerItr) {
|
for (++innerItr; innerItr != end; ++innerItr) {
|
||||||
@ -1239,7 +1240,7 @@ public:
|
|||||||
|
|
||||||
return validated;
|
return validated;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user