Bug 1132499 - part 1 - convert nsTextEditorState::mValue to use Maybe instead of heap allocation; r=ehsan

This change is just a minor tidying; we need to distinguish between
"have a value" and "don't have a value" in nsTextEditorState::GetValue,
but we can do better than heap-allocating the string.
This commit is contained in:
Nathan Froyd
2016-03-04 09:56:13 -05:00
parent f8a977d013
commit 6b6313c0b3
2 changed files with 3 additions and 2 deletions

View File

@@ -2139,7 +2139,7 @@ nsTextEditorState::SetValue(const nsAString& aValue, uint32_t aFlags)
}
} else {
if (!mValue) {
mValue = new nsCString;
mValue.emplace();
}
nsString value;
if (!value.Assign(newValue, fallible)) {