From 3c672cded7a768af55efbfa560b18709cf15ea30 Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Tue, 17 Dec 2019 15:28:22 +1300 Subject: [PATCH] Fix integer type used by ESet This should be Xapian::termcount, not Xapian::doccount. In a standard build both are the same underlying type, so this won't usually matter. (cherry picked from commit bef58081e820484220c222c775a89e49bd3abeab) --- xapian-core/expand/esetinternal.cc | 4 ++-- xapian-core/include/xapian/eset.h | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/xapian-core/expand/esetinternal.cc b/xapian-core/expand/esetinternal.cc index ffebf8005..8c3ffb585 100644 --- a/xapian-core/expand/esetinternal.cc +++ b/xapian-core/expand/esetinternal.cc @@ -243,11 +243,11 @@ ESet::operator=(ESet &&) = default; ESet::~ESet() { } -Xapian::doccount +Xapian::termcount ESet::size() const { if (!internal.get()) return 0; - return internal->items.size(); + return Xapian::termcount(internal->items.size()); } Xapian::termcount diff --git a/xapian-core/include/xapian/eset.h b/xapian-core/include/xapian/eset.h index 7d1ad6580..0416a3b52 100644 --- a/xapian-core/include/xapian/eset.h +++ b/xapian-core/include/xapian/eset.h @@ -79,7 +79,7 @@ class XAPIAN_VISIBILITY_DEFAULT ESet { ~ESet(); /** Return number of items in this ESet object. */ - Xapian::doccount size() const; + Xapian::termcount size() const; /** Return true if this ESet object is empty. */ bool empty() const { return size() == 0; } @@ -101,7 +101,7 @@ class XAPIAN_VISIBILITY_DEFAULT ESet { ESetIterator end() const; /** Return iterator pointing to the i-th object in this ESet. */ - ESetIterator operator[](Xapian::doccount i) const; + ESetIterator operator[](Xapian::termcount i) const; /** Return iterator pointing to the last object in this ESet. */ ESetIterator back() const; @@ -152,7 +152,7 @@ class XAPIAN_VISIBILITY_DEFAULT ESet { */ // @{ // The size is fixed once created. - Xapian::doccount max_size() const { return size(); } + Xapian::termcount max_size() const { return size(); } // @} }; @@ -160,7 +160,7 @@ class XAPIAN_VISIBILITY_DEFAULT ESet { class XAPIAN_VISIBILITY_DEFAULT ESetIterator { friend class ESet; - ESetIterator(const Xapian::ESet & eset_, Xapian::doccount off_from_end_) + ESetIterator(const Xapian::ESet & eset_, Xapian::termcount off_from_end_) : eset(eset_), off_from_end(off_from_end_) { } public: @@ -354,7 +354,7 @@ ESet::end() const { } inline ESetIterator -ESet::operator[](Xapian::doccount i) const { +ESet::operator[](Xapian::termcount i) const { return ESetIterator(*this, size() - i); } -- 2.11.4.GIT