Commit 1e02318b authored by Simon Giesecke's avatar Simon Giesecke
Browse files

Bug 1653335 - Replace MakeSpan uses by constructor calls. r=froydnj

parent 48dd75b2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -467,8 +467,8 @@ already_AddRefed<FormData> BodyUtil::ConsumeFormData(nsIGlobalObject* aParent,
// static
nsresult BodyUtil::ConsumeText(uint32_t aInputLength, uint8_t* aInput,
                               nsString& aText) {
  nsresult rv = UTF_8_ENCODING->DecodeWithBOMRemoval(
      MakeSpan(aInput, aInputLength), aText);
  nsresult rv =
      UTF_8_ENCODING->DecodeWithBOMRemoval(Span(aInput, aInputLength), aText);
  if (NS_FAILED(rv)) {
    return rv;
  }
+1 −1
Original line number Diff line number Diff line
@@ -286,7 +286,7 @@ nsresult CharacterData::SetTextInternal(
    if (aLength) {
      to.Append(aBuffer, aLength);
      if (!bidi && (!document || !document->GetBidiEnabled())) {
        bidi = HasRTLChars(MakeSpan(aBuffer, aLength));
        bidi = HasRTLChars(Span(aBuffer, aLength));
      }
    }
    if (endOffset != textLength) {
+2 −2
Original line number Diff line number Diff line
@@ -119,7 +119,7 @@ already_AddRefed<Document> DOMParser::ParseFromBuffer(const Uint8Array& aBuf,
                                                      SupportedType aType,
                                                      ErrorResult& aRv) {
  aBuf.ComputeState();
  return ParseFromBuffer(MakeSpan(aBuf.Data(), aBuf.Length()), aType, aRv);
  return ParseFromBuffer(Span(aBuf.Data(), aBuf.Length()), aType, aRv);
}

already_AddRefed<Document> DOMParser::ParseFromBuffer(Span<const uint8_t> aBuf,
@@ -129,7 +129,7 @@ already_AddRefed<Document> DOMParser::ParseFromBuffer(Span<const uint8_t> aBuf,
  nsCOMPtr<nsIInputStream> stream;
  nsresult rv = NS_NewByteInputStream(
      getter_AddRefs(stream),
      MakeSpan(reinterpret_cast<const char*>(aBuf.Elements()), aBuf.Length()),
      Span(reinterpret_cast<const char*>(aBuf.Elements()), aBuf.Length()),
      NS_ASSIGNMENT_DEPEND);
  if (NS_FAILED(rv)) {
    aRv.Throw(rv);
+1 −1
Original line number Diff line number Diff line
@@ -172,7 +172,7 @@ void DocumentOrShadowRoot::SetAdoptedStyleSheets(
  mAdoptedStyleSheets.SetCapacity(aAdoptedStyleSheets.Length());

  // Only add sheets that are not already in the common prefix.
  for (const auto& sheet : MakeSpan(aAdoptedStyleSheets).From(commonPrefix)) {
  for (const auto& sheet : Span(aAdoptedStyleSheets).From(commonPrefix)) {
    if (MOZ_UNLIKELY(!set.EnsureInserted(sheet))) {
      // The idea is that this case is rare, so we pay the price of removing the
      // old sheet from the styles and append it later rather than the other way
+2 −2
Original line number Diff line number Diff line
@@ -759,8 +759,8 @@ void EventSourceImpl::ParseSegment(const char* aBuffer, uint32_t aLength) {
    return;
  }
  char16_t buffer[1024];
  auto dst = MakeSpan(buffer);
  auto src = AsBytes(MakeSpan(aBuffer, aLength));
  auto dst = Span(buffer);
  auto src = AsBytes(Span(aBuffer, aLength));
  // XXX EOF handling is https://bugzilla.mozilla.org/show_bug.cgi?id=1369018
  for (;;) {
    uint32_t result;
Loading