summaryrefslogtreecommitdiff
path: root/dom/fetch/InternalHeaders.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dom/fetch/InternalHeaders.cpp')
-rw-r--r--dom/fetch/InternalHeaders.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/dom/fetch/InternalHeaders.cpp b/dom/fetch/InternalHeaders.cpp
index 11585615ea..83a6867851 100644
--- a/dom/fetch/InternalHeaders.cpp
+++ b/dom/fetch/InternalHeaders.cpp
@@ -316,10 +316,11 @@ InternalHeaders::Fill(const Sequence<Sequence<nsCString>>& aInit, ErrorResult& a
void
InternalHeaders::Fill(const MozMap<nsCString>& aInit, ErrorResult& aRv)
{
- nsTArray<nsString> keys;
- aInit.GetKeys(keys);
- for (uint32_t i = 0; i < keys.Length() && !aRv.Failed(); ++i) {
- Append(NS_ConvertUTF16toUTF8(keys[i]), aInit.Get(keys[i]), aRv);
+ for (auto& entry : aInit.Entries()) {
+ Append(NS_ConvertUTF16toUTF8(entry.mKey), entry.mValue, aRv);
+ if (aRv.Failed()) {
+ return;
+ }
}
}