Bug 1343715 - Split nsTSubstring::mFlags into separate variables for class and data flags. r=dmajor

MozReview-Commit-ID: JW1p5BxpHKA
This commit is contained in:
L. David Baron
2017-07-10 12:23:10 -07:00
parent ec88589cfe
commit 202e05578a
15 changed files with 224 additions and 194 deletions

View File

@@ -11,7 +11,7 @@ nsTAdoptingString_CharT::operator=(const self_type& str)
// the nature of this class...
self_type* mutable_str = const_cast<self_type*>(&str);
if (str.mFlags & F_OWNED) {
if (str.mDataFlags & DataFlags::OWNED) {
// We want to do what Adopt() does, but without actually incrementing
// the Adopt count. Note that we can be a little more straightforward
// about this than Adopt() is, because we know that str.mData is
@@ -20,7 +20,7 @@ nsTAdoptingString_CharT::operator=(const self_type& str)
Finalize();
mData = str.mData;
mLength = str.mLength;
SetDataFlags(F_TERMINATED | F_OWNED);
SetDataFlags(DataFlags::TERMINATED | DataFlags::OWNED);
// Make str forget the buffer we just took ownership of.
new (mutable_str) self_type();
@@ -41,7 +41,7 @@ nsTString_CharT::Rebind(const char_type* data, size_type length)
mData = const_cast<char_type*>(data);
mLength = length;
SetDataFlags(F_TERMINATED);
SetDataFlags(DataFlags::TERMINATED);
AssertValidDependentString();
}