Skip to content
Snippets Groups Projects
Commit 45f8f46d authored by Paweł Kędzia's avatar Paweł Kędzia
Browse files

While Corpus is empty, next_document in corpus returns empty shared_ptr to Document

parent 708b5372
No related merge requests found
...@@ -51,9 +51,14 @@ public: ...@@ -51,9 +51,14 @@ public:
/// Next document in corpus /// Next document in corpus
boost::shared_ptr<Document> next_document() { boost::shared_ptr<Document> next_document() {
if (!this->set_) { if (!this->set_) {
this->set_ = true; if (this->documents_.size() == 0) {
this->current_document_ = documents_.begin(); boost::shared_ptr<Document> tmp;
return tmp;
}
else {
this->set_ = true;
this->current_document_ = documents_.begin();
}
} }
else { else {
current_document_++; current_document_++;
......
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