mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 04:38:02 +00:00

MozReview-Commit-ID: JW1p5BxpHKA --HG-- extra : transplant_source : %20e%CF%FA%60%A2%1Bn%1A%C6%A2%DBAy%3C%E0b%0C%077
20 lines
695 B
C++
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);
|
|
}
|
|
}
|