* mu-msg-iter: remove offset/index, cosmetics

This commit is contained in:
Dirk-Jan C. Binnema
2011-06-02 17:59:49 +03:00
parent 9531cb9cd5
commit 4c1baccc86
2 changed files with 20 additions and 49 deletions

View File

@ -31,11 +31,10 @@
static gboolean update_msg (MuMsgIter *iter);
struct _MuMsgIter {
_MuMsgIter (const Xapian::Enquire &enq, size_t maxnum):
_enq(enq), _maxnum(maxnum), _offset(0), _msg(0) {
_enq(enq), _msg(0) {
_matches = _enq.get_mset (0, _maxnum);
_matches = _enq.get_mset (0, maxnum);
_cursor = _matches.begin();
if (!_matches.empty())
@ -50,7 +49,6 @@ struct _MuMsgIter {
const Xapian::Enquire _enq;
Xapian::MSet _matches;
Xapian::MSet::const_iterator _cursor;
size_t _maxnum, _offset;
Xapian::Document _doc;
MuMsg *_msg;
@ -136,7 +134,6 @@ mu_msg_iter_next (MuMsgIter *iter)
try {
++iter->_cursor;
++iter->_offset;
if (mu_msg_iter_is_done(iter))
return FALSE; /* no more matches */
@ -187,9 +184,6 @@ mu_msg_iter_get_field (MuMsgIter *iter, MuMsgFieldId mfid)
return get_field (iter, mfid);
}
static gint64
get_field_numeric (MuMsgIter *iter, MuMsgFieldId mfid)
{
@ -206,16 +200,6 @@ mu_msg_iter_get_field_numeric (MuMsgIter *iter, MuMsgFieldId mfid)
return get_field_numeric (iter, mfid);
}
unsigned int
mu_msg_iter_get_index (MuMsgIter *iter)
{
g_return_val_if_fail (iter, (unsigned int)-1);
return iter->_offset;
}
/* hmmm.... is it impossible to get a 0 docid, or just very improbable? */
unsigned int
mu_msg_iter_get_docid (MuMsgIter *iter)

View File

@ -107,19 +107,6 @@ MuMsg* mu_msg_iter_get_msg (MuMsgIter *iter, GError **err)
unsigned int mu_msg_iter_get_docid (MuMsgIter *iter);
/**
* get the index for this iterator (ie. somewhere between [0..n-1],
* with being the number of matches, and increasing 1 for each
* iter_next)
*
* @param iter a valid MuMsgIter
*
* @return the index or (unsigned int)-1 in case of error
*/
unsigned int mu_msg_iter_get_index (MuMsgIter *iter);
/**
* get some message field
*