Refactor glass backend key comparison
commitd8611f4c26012b3f6e285fe9ca48caea31dcc8e9
authorOlly Betts <olly@survex.com>
Mon, 14 Mar 2016 05:28:13 +0000 (14 18:28 +1300)
committerOlly Betts <olly@survex.com>
Mon, 14 Mar 2016 05:28:13 +0000 (14 18:28 +1300)
tree861657b2a3b4db71a5470525df5fc5f89eb468fd
parentfac5fbf40652571380166ec653bb5c9e252d616a
Refactor glass backend key comparison

Instead of comparing Key objects, compare BItem and LeafItem objects by
their keys, which is mainly an enabler for future changes.

Instead of operator== and operator<, provide a compare() function
which returns negative, 0 or positive, like strcmp(), memcmp() and
std::string::compare().  This allows us to avoid a final compare to
check for equality in GlassTable::find_in_leaf(), and to terminate
early if the binary chop hits the exact entry.
xapian-core/backends/glass/glass_check.cc
xapian-core/backends/glass/glass_table.cc
xapian-core/backends/glass/glass_table.h