[Xapian-tickets] [Xapian] #785: Use std::string_view whenever possible

Xapian nobody at xapian.org
Thu May 9 06:10:52 BST 2019


#785: Use std::string_view whenever possible
-------------------------+-------------------------
 Reporter:  Kronuz       |             Owner:  olly
     Type:  enhancement  |            Status:  new
 Priority:  normal       |         Milestone:
Component:  Other        |           Version:
 Severity:  normal       |        Resolution:
 Keywords:               |        Blocked By:
 Blocking:               |  Operating System:  All
-------------------------+-------------------------

Comment (by olly):

 Such a refactor to an API method isn't the hard part though - to actually
 be useful that then requires chasing through everywhere inside the library
 where that `std::string` is currently passed and changing all of those to
 also take a pointer and length in the same way.

 Unless someone with an awful lot of spare time is keen to make it happen,
 I think planning to do this "whenever possible" isn't realistic.
 Targetting a few places where it would actually deliver a significant gain
 might be though.

 One method which comes to mind where someone might want to pass a
 substring of a large string or a large value from a buffer is
 `Xapian::TermGenerator::index_text()`, but that already supports passing a
 `Xapian::Utf8Iterator` and that can be constructed from a `const char*`
 and `size_t`.

--
Ticket URL: <https://trac.xapian.org/ticket/785#comment:3>
Xapian <https://xapian.org/>
Xapian



More information about the Xapian-tickets mailing list