[Xapian-devel] mutable Query objects

Richard Boulton richard at tartarus.org
Thu Feb 24 18:04:20 GMT 2005


On Thu, 2005-02-24 at 16:54 +0000, Olly Betts wrote:
> (a) implement a "deep copy" clone for Query objects and use it in
> Enquire::set_query()
> 
> (b) make Query object immutable by replacing these non-const public
> methods with extra constructor parameters:

I'd favour (b) too.  The query objects aren't usefully mutable, anyway
(I can't think of a situation where it would be useful to take advantage
of them being mutable), so it would be a waste of coding and testing
time to implement a deep copy operation.  Also, it would mean that a
deep copy had to be performed every time a query is set, which currently
doesn't need to happen, so it will slow down the common case.

-- 
Richard Boulton <richard at tartarus.org>





More information about the Xapian-devel mailing list