[PATCH 06/11] lib: Internal support for querying and creating ghost messages

David Bremner david at tethera.net
Sun Oct 5 23:19:10 PDT 2014


Austin Clements <aclements at csail.mit.edu> writes:

>
> I'm used to reading this stuff, so either way is fine with me.  Do we
> have bit set / clear / read macros?
>

I guess not. the things we have in query.cc are related but different.

>> > +	else if (*i == "Tghost")
>> > +	    message->flags |= (1 << NOTMUCH_MESSAGE_FLAG_GHOST);
>> > +	else
>> 
>> It makes me faintly unhappy to have the prefix hardcoded here.
>> Not sure if there is a sensible solution.
>
> I agree, but I also don't want to construct the test string every time
> or deconstruct the term string every time.  I could move the "T"
> prefix string to a #define and use that both here and in
> BOOLEAN_PREFIX_INTERNAL, but that solution may be worse than the
> problem.  What do you think?

Maybe just a comment to point to BOOLEAN_PREFIX_INTERNAL.

Or maybe define a macro right beside BOOLEAN_PREFIX_INTERNAL like

#define ADD_TYPE_PREFIX(s) "T" s

At least then the duplication is all in one place.


More information about the notmuch mailing list