Bug 1587905 - Remove useless variable 'bytesAllocated' declaration & assignation r=sfink

Differential Revision: https://phabricator.services.mozilla.com/D48888

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Sylvestre Ledru 2019-10-11 19:06:41 +00:00
Родитель 5f2a4a2274
Коммит d31a8b68f3
1 изменённых файлов: 5 добавлений и 8 удалений

Просмотреть файл

@ -2901,10 +2901,9 @@ static nsresult ReadSourceFromFilename(JSContext* cx, const char* filename,
ptr += bytesRead;
}
size_t bytesAllocated;
if (utf8Source) {
// |buf| is already UTF-8, so we can directly return it.
*len = bytesAllocated = rawLen;
*len = rawLen;
*utf8Source = buf.release();
} else {
MOZ_ASSERT(twoByteSource != nullptr);
@ -2920,8 +2919,6 @@ static nsresult ReadSourceFromFilename(JSContext* cx, const char* filename,
if (!*twoByteSource) {
return NS_ERROR_FAILURE;
}
bytesAllocated = *len * sizeof(char16_t);
}
return NS_OK;
@ -3023,7 +3020,7 @@ js::UniquePtr<EdgeRange> ReflectorNode::edges(JSContext* cx,
// to guard against uninitialized objects.
nsISupports* supp = UnwrapDOMObjectToISupports(&get());
if (supp) {
JS::AutoSuppressGCAnalysis nogc; // bug 1582326
JS::AutoSuppressGCAnalysis nogc; // bug 1582326
nsINode* node;
// UnwrapDOMObjectToISupports can only return non-null if its argument is
@ -3284,7 +3281,7 @@ JSObject* XPCJSRuntime::GetUAWidgetScope(JSContext* cx,
RefPtr<BasePrincipal> key = BasePrincipal::Cast(principal);
if (Principal2JSObjectMap::Ptr p = mUAWidgetScopeMap.lookup(key)) {
scope = p->value();
break; // Need ~RefPtr to run, and potentially GC, before returning.
break; // Need ~RefPtr to run, and potentially GC, before returning.
}
SandboxOptions options;
@ -3298,12 +3295,12 @@ JSObject* XPCJSRuntime::GetUAWidgetScope(JSContext* cx,
nsTArray<nsCOMPtr<nsIPrincipal>> principalAsArray(1);
principalAsArray.AppendElement(principal);
RefPtr<ExpandedPrincipal> ep = ExpandedPrincipal::Create(
principalAsArray, principal->OriginAttributesRef());
principalAsArray, principal->OriginAttributesRef());
// Create the sandbox.
RootedValue v(cx);
nsresult rv = CreateSandboxObject(
cx, &v, static_cast<nsIExpandedPrincipal*>(ep), options);
cx, &v, static_cast<nsIExpandedPrincipal*>(ep), options);
NS_ENSURE_SUCCESS(rv, nullptr);
scope = &v.toObject();