gecko-dev/xpcom/string/nsTPromiseFlatString.cpp
L. David Baron c59666d841 Bug 1343715 - Split nsTSubstring::mFlags into separate variables for class and data flags. r=dmajor
MozReview-Commit-ID: JW1p5BxpHKA

--HG--
extra : transplant_source : %20e%CF%FA%60%A2%1Bn%1A%C6%A2%DBAy%3C%E0b%0C%077
2017-07-10 12:23:10 -07:00

20 lines
695 B
C++

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
void
nsTPromiseFlatString_CharT::Init(const substring_type& str)
{
if (str.IsTerminated()) {
mData = const_cast<char_type*>(static_cast<const char_type*>(str.Data()));
mLength = str.Length();
mDataFlags =
str.GetDataFlags() & (DataFlags::TERMINATED | DataFlags::LITERAL);
// does not promote DataFlags::VOIDED
} else {
Assign(str);
}
}