Skip to content

Commit

Permalink
Minor improvements to Fleece.hh
Browse files Browse the repository at this point in the history
as suggested by clang-tidy
  • Loading branch information
snej committed Aug 5, 2024
1 parent fc9f85f commit d46257c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions API/fleece/Fleece.hh
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ namespace fleece {
inline Value operator * () const {return value();}
inline explicit operator bool() const {return (bool)value();}
inline iterator& operator++ () {next(); return *this;}
inline bool operator!= (const iterator&) {return value() != nullptr;}
inline bool operator!= (const iterator&) const {return value() != nullptr;}
inline Value operator[] (unsigned n) const {return FLArrayIterator_GetValueAt(this,n);}
private:
iterator() =default;
Expand Down Expand Up @@ -255,8 +255,8 @@ namespace fleece {
KeyPath(slice_NONNULL spec, FLError* FL_NULLABLE err) :_path(FLKeyPath_New(spec, err)) { }
~KeyPath() {FLKeyPath_Free(_path);}

KeyPath(KeyPath &&kp) :_path(kp._path) {kp._path = nullptr;}
KeyPath& operator=(KeyPath &&kp) {FLKeyPath_Free(_path); _path = kp._path;
KeyPath(KeyPath &&kp) noexcept :_path(kp._path) {kp._path = nullptr;}
KeyPath& operator=(KeyPath &&kp) noexcept {FLKeyPath_Free(_path); _path = kp._path;
kp._path = nullptr; return *this;}

KeyPath(const KeyPath &kp) :KeyPath(std::string(kp), nullptr) { }
Expand Down Expand Up @@ -318,7 +318,7 @@ namespace fleece {
external pointers to. */
class Doc {
public:
Doc(alloc_slice fleeceData,
Doc(const alloc_slice& fleeceData,
FLTrust trust =kFLUntrusted,
FLSharedKeys FL_NULLABLE sk =nullptr,
slice externDest =nullslice) noexcept
Expand Down Expand Up @@ -399,7 +399,7 @@ namespace fleece {
explicit Encoder(FLSharedKeys FL_NULLABLE sk) :Encoder() {setSharedKeys(sk);}

explicit Encoder(FLEncoder enc) :_enc(enc) { }
Encoder(Encoder&& enc) :_enc(enc._enc) {enc._enc = nullptr;}
Encoder(Encoder&& enc) noexcept :_enc(enc._enc) {enc._enc = nullptr;}

void detach() {_enc = nullptr;}

Expand All @@ -418,7 +418,7 @@ namespace fleece {
inline bool writeDouble(double);
inline bool writeString(slice);
inline bool writeString(const char *s) {return writeString(slice(s));}
inline bool writeString(std::string s) {return writeString(slice(s));}
inline bool writeString(const std::string& s) {return writeString(slice(s));}
inline bool writeDateString(FLTimestamp, bool asUTC =true);
inline bool writeData(slice);
inline bool writeValue(Value);
Expand Down

0 comments on commit d46257c

Please sign in to comment.