Mercurial > hg > orthanc
diff OrthancServer/Search/SetOfResources.cpp @ 1751:fb569ee09a69 db-changes
LookupResource complete
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 27 Oct 2015 16:05:42 +0100 |
parents | 55d52567bebb |
children | faf2ecab3472 |
line wrap: on
line diff
--- a/OrthancServer/Search/SetOfResources.cpp Tue Oct 27 12:45:50 2015 +0100 +++ b/OrthancServer/Search/SetOfResources.cpp Tue Oct 27 16:05:42 2015 +0100 @@ -150,4 +150,24 @@ } } } + + + bool SetOfResources::Flatten(std::list<int64_t>& result, + size_t maxResults) + { + Flatten(result); + + if (maxResults != 0 && + result.size() > maxResults) + { + std::list<int64_t>::iterator cut = result.begin(); + std::advance(cut, maxResults); + result.erase(cut, result.end()); + return false; + } + else + { + return true; + } + } }