1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-28 06:43:01 +04:00

Add a test for FileNode::keys()

This commit is contained in:
Dmitry Kurtaev
2018-11-12 13:38:18 +03:00
parent 93d1785820
commit 6c76c8f881
2 changed files with 11 additions and 6 deletions
+5 -6
View File
@@ -271,14 +271,13 @@ FileNode FileNode::operator[](int i) const
std::vector<String> FileNode::keys() const
{
CV_Assert(isMap());
std::vector<String> res;
if (isMap())
res.reserve(size());
for (FileNodeIterator it = begin(); it != end(); ++it)
{
res.reserve(size());
for (FileNodeIterator it = begin(); it != end(); ++it)
{
res.push_back((*it).name());
}
res.push_back((*it).name());
}
return res;
}