Simpilfy MutableSlice constructor (behavior is defined since C++11).
GitOrigin-RevId: 77c07d8abc0b6c10f24e95f61811fe6d5ca3af58
This commit is contained in:
parent
5368c96a41
commit
570a59f1d4
@ -26,11 +26,7 @@ inline MutableSlice::MutableSlice(unsigned char *s, size_t len) : s_(reinterpret
|
||||
CHECK(s_ != nullptr);
|
||||
}
|
||||
|
||||
inline MutableSlice::MutableSlice(string &s) : MutableSlice() {
|
||||
if (!s.empty()) {
|
||||
s_ = &s[0];
|
||||
len_ = s.size();
|
||||
}
|
||||
inline MutableSlice::MutableSlice(string &s) : s_(&s[0]), len_(s.size()) {
|
||||
}
|
||||
|
||||
template <class T>
|
||||
|
Reference in New Issue
Block a user