int
SBuf::compare(const SBuf &S, const SBufCaseSensitive isCaseSensitive, const size_type n) const
{
- if (n != npos)
- return substr(0,n).compare(S.substr(0,n),isCaseSensitive);
+ if (n != npos) {
+ const SBuf s1 = substr(0,n);
+ const SBuf s2 = S.substr(0,n);
+ return s1.compare(s2,isCaseSensitive, n);
+ }
const size_type byteCompareLen = min(S.length(), length());
++stats.compareSlow;
/// create an empty (zero-size) SBuf
SBuf();
SBuf(const SBuf &S);
+ SBuf(SBuf&& S) {
+ store_=S.store_; off_=S.off_; len_=S.len_;
+ S.store_=GetStorePrototype(); S.off_=0; S.len_=0;
+ }
/** Constructor: import c-style string
*