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:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user