Improve condition
This commit is contained in:
parent
13fa86fee3
commit
983a0a6bbb
@ -254,10 +254,9 @@ struct convert<std::array<T, N>> {
|
||||
}
|
||||
|
||||
static bool decode(const Node& node, std::array<T, N>& rhs) {
|
||||
if (!node.IsSequence())
|
||||
if (!isNodeValid(node)) {
|
||||
return false;
|
||||
if (node.size() != N)
|
||||
return false;
|
||||
}
|
||||
|
||||
for (auto i = 0u; i < node.size(); ++i) {
|
||||
#if defined(__GNUC__) && __GNUC__ < 4
|
||||
@ -269,6 +268,12 @@ struct convert<std::array<T, N>> {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
static bool isNodeValid(const Node& node) {
|
||||
return node.IsSequence() && node.size() == N;
|
||||
}
|
||||
};
|
||||
|
||||
// std::pair
|
||||
|
||||
Loading…
Reference in New Issue
Block a user