keys.hh: simplify empty clustering-key check
keys.hh: simplify empty clustering-key check

The exploded_clustering_prefix type has a convenient is_empty() method
and an even more convenient "operator bool" shortcut. Unfortunately,
the other clustering prefix types (clustering_key_prefix,
clustering_key_prefix_view) have, for historic reasons, an is_empty
method which takes a schema parameter. That also means they can't
have an "operator bool" shortcut.

But checking if a prefix doesn't really need the schema - all we need to
check is whether the byte representation is empty. The result is simpler
and more efficient code, and easier to use. It is also more consistent -
all clustering-key-related types will have an "operator bool" instead of
just some of them.

To avoid massive code changes, we leave a is_empty(schema) variant, which
simply calls is_empty(). There's already precedent for that - various
methods which have a variant taking schema (and ignoring it) and one
taking nothing.

Signed-off-by: Nadav Har'El <625169824b719df98706d88646d0aae6f368ae4d@scylladb.com>
Message-Id: <20180521174220.13262-1-625169824b719df98706d88646d0aae6f368ae4d@scylladb.com>

scylladb/scylla,avikivity/scylla,avikivity/scylla,avikivity/scylla,duarten/scylla,duarten/scylla,scylladb/scylla,scylladb/scylla,scylladb/scylla,duarten/scylla