Commit 4efe19bc authored by Matthieu Dorier's avatar Matthieu Dorier

Fixing bug with listing DataSets.

parent c6fb1562
......@@ -24,8 +24,8 @@ void navigate_dataset(int level, hepnos::DataSet& ds) {
for(auto& sub_ds : ds) {
navigate_dataset(level+1, sub_ds);
}
for(auto& r : ds.runs()) {
navigate_run(level+1, r);
for(auto it = ds.runs().begin(); it != ds.runs().end(); it++) {
navigate_run(level+1, *it);
}
}
......
......@@ -52,7 +52,7 @@ struct UUID {
template<typename T>
T& operator<<(T& stream, const UUID& id) {
stream << (std::string)id;
stream << id.to_string();
return stream;
}
......
......@@ -391,6 +391,7 @@ class DataStoreImpl {
throw Exception("Error occured when calling sdskv::database::list_keys (SDSKV error="+std::string(ex.what()) + ")");
}
result.resize(0);
unsigned j=0;
for(const auto& entry : entries) {
size_t i = entry.find_last_of('/');
if(i == std::string::npos) i = 1;
......@@ -401,9 +402,10 @@ class DataStoreImpl {
level,
current->m_container,
entry.substr(i),
uuids[i]
uuids[j]
)
);
j += 1;
}
return result.size();
}
......
......@@ -181,7 +181,7 @@ Run::const_iterator Run::find(const SubRunNumber& subRunNumber) const {
Run::iterator Run::begin() {
auto it = find(0);
if(it != end()) return *it;
if(it != end()) return it;
auto& id = m_impl->m_descriptor;
auto new_subrun_impl = std::make_shared<ItemImpl>(m_impl->m_datastore, id.dataset, id.run, 0);
......
......@@ -56,7 +56,7 @@ RunSet::const_iterator RunSet::find(const RunNumber& runNumber) const {
RunSet::iterator RunSet::begin() {
auto it = find(0);
if(it != end()) return *it;
if(it != end()) return it;
auto ds_level = m_impl->m_level;
auto datastore = m_impl->m_datastore;
......
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