Skip to content

Commit dee1b25

Browse files
committed
feat(bigtable): add Clear(std::string&) helper for RowKeyType compatibility
Adds a Clear(std::string&) function that calls std::string::clear() in OSS builds. This unifies the interface for clearing row keys between OSS (std::string) and Google internal (absl::Cord), where an overload will call absl::Cord::Clear() instead of deprecated clear(). Signed-off-by: Dronaraj Gyawali <dronarajgyawali@gmail.com>
1 parent 81c1d01 commit dee1b25

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

google/cloud/bigtable/internal/google_bytes_traits.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ namespace internal {
3838
/// Return true if the row key is empty.
3939
inline bool IsEmptyRowKey(std::string const& key) { return key.empty(); }
4040

41+
/// Clear the row key.
42+
inline void Clear(std::string& key) { key.clear(); }
43+
4144
/// Return true if the row key is empty.
4245
inline bool IsEmptyRowKey(char const* key) { return std::string{} == key; }
4346

0 commit comments

Comments
 (0)