message/field: cache the message's sexp
Keep it in the store; much faster than generating on the fly.
This commit is contained in:
@ -140,13 +140,10 @@ add_date_and_size(Sexp::List& items, const Message& message)
|
||||
}
|
||||
|
||||
Mu::Sexp::List
|
||||
Message::to_sexp_list(unsigned docid) const
|
||||
Message::to_sexp_list() const
|
||||
{
|
||||
Sexp::List items;
|
||||
|
||||
if (docid != 0)
|
||||
items.add_prop(":docid", Sexp::make_number(docid));
|
||||
|
||||
add_prop_nonempty(items, ":subject", subject());
|
||||
add_prop_nonempty(items, ":message-id", message_id());
|
||||
add_prop_nonempty(items, ":mailing-list", mailing_list());
|
||||
@ -169,7 +166,7 @@ Message::to_sexp_list(unsigned docid) const
|
||||
}
|
||||
|
||||
Mu::Sexp
|
||||
Message::to_sexp(unsigned docid) const
|
||||
Message::to_sexp() const
|
||||
{
|
||||
return Sexp::make_list(to_sexp_list());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user