Skip to content

Commit

Permalink
Bug 1628715 - Part 3: Make fallible nsTArray::Assign nodiscard. r=xpc…
Browse files Browse the repository at this point in the history
…om-reviewers,erahm

Differential Revision: https://phabricator.services.mozilla.com/D70384
  • Loading branch information
sigiesec committed Apr 24, 2020
1 parent 3ff0c69 commit 93004ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions dom/prio/test/gtest/TestPrioEncoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ TEST(PrioEncoder, BooleanLimitExceeded)
*(sequence.AppendElement(mozilla::fallible)) = rand() % 2;
}

prioParams.mBooleans.Assign(sequence);
ASSERT_TRUE(prioParams.mBooleans.Assign(sequence));

mozilla::dom::RootedDictionary<mozilla::dom::PrioEncodedData> prioEncodedData(
cx);
Expand Down Expand Up @@ -183,7 +183,7 @@ TEST(PrioEncoder, VerifyFull)
*(sequence.AppendElement(mozilla::fallible)) = dataItems[0];
*(sequence.AppendElement(mozilla::fallible)) = dataItems[1];
*(sequence.AppendElement(mozilla::fallible)) = dataItems[2];
prioParams.mBooleans.Assign(sequence);
ASSERT_TRUE(prioParams.mBooleans.Assign(sequence));

mozilla::dom::RootedDictionary<mozilla::dom::PrioEncodedData> prioEncodedData(
cx);
Expand Down
2 changes: 1 addition & 1 deletion xpcom/ds/nsTArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -1467,7 +1467,7 @@ class nsTArray_Impl
//

template <class Allocator, typename ActualAlloc = Alloc>
typename ActualAlloc::ResultType Assign(
[[nodiscard]] typename ActualAlloc::ResultType Assign(
const nsTArray_Impl<E, Allocator>& aOther) {
return ActualAlloc::ConvertBoolToResultType(
!!ReplaceElementsAt<E, ActualAlloc>(0, Length(), aOther.Elements(),
Expand Down

0 comments on commit 93004ea

Please sign in to comment.