diff options
author | Tor Brede Vekterli <vekterli@yahooinc.com> | 2022-03-24 12:58:27 +0000 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@yahooinc.com> | 2022-03-24 13:50:19 +0000 |
commit | 5560e8dee6b87f89a2324dd90b89c2c233ab32a2 (patch) | |
tree | 619f799baeeffcee5e2904f0346b97958eebee1e /documentapi | |
parent | d670aad5992c35f8b5e3bf9e6666319eccd93ed3 (diff) |
Use vespalib::string in TestAndSetCondition
Avoids some implicit conversions. Add `starts_with` to `vespalib::string`
and `vespalib::stringref` to allow drop-in replacement for Document API code.
Diffstat (limited to 'documentapi')
-rw-r--r-- | documentapi/src/vespa/documentapi/messagebus/messages/testandsetcondition.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/documentapi/src/vespa/documentapi/messagebus/messages/testandsetcondition.h b/documentapi/src/vespa/documentapi/messagebus/messages/testandsetcondition.h index 4ed291ecd68..6b8fc87d7ce 100644 --- a/documentapi/src/vespa/documentapi/messagebus/messages/testandsetcondition.h +++ b/documentapi/src/vespa/documentapi/messagebus/messages/testandsetcondition.h @@ -2,18 +2,20 @@ // @author Vegard Sjonfjell #pragma once +#include <vespa/vespalib/stllike/string.h> + namespace documentapi { class TestAndSetCondition { private: - std::string _selection; + vespalib::string _selection; public: TestAndSetCondition() : _selection() {} - TestAndSetCondition(vespalib::stringref selection) + explicit TestAndSetCondition(vespalib::stringref selection) : _selection(selection) {} @@ -23,7 +25,7 @@ public: TestAndSetCondition(TestAndSetCondition &&) = default; TestAndSetCondition & operator=(TestAndSetCondition &&) = default; - const std::string & getSelection() const { return _selection; } + const vespalib::string & getSelection() const { return _selection; } bool isPresent() const { return !_selection.empty(); } }; |