Closed Bug 1604397 Opened 5 years ago Closed 5 years ago

Dead assignment in WebGLContext::GetParameter

Categories

(Core :: Graphics: CanvasWebGL, task, P3)

task

Tracking

()

RESOLVED DUPLICATE of bug 1477756

People

(Reporter: alexhenrie24, Assigned: alexhenrie24)

Details

Attachments

(1 file)

WebGLContext::GetParameter currently has some code that looks like this:

bool hasRetVal = false;

nsAutoString ret;
if (overridePref) {
  nsresult res = Preferences::GetString(overridePref, ret);
  if (NS_SUCCEEDED(res) && ret.Length() > 0) hasRetVal = true;
}

if (!hasRetVal) {
  const char* chars =
      reinterpret_cast<const char*>(gl->fGetString(driverEnum));
  ret = NS_ConvertASCIItoUTF16(chars);
  hasRetVal = true;
}

return StringValue(cx, ret, rv);

hasRetVal has no purpose after the last if statement and doesn't need to be set to true right before returning from the function. This assignment has been a dead assignment ever since it was added in July 2015 as part of the fix for Bug 1171228.

Assignee: nobody → alexhenrie24
Status: NEW → ASSIGNED
Type: defect → task
Priority: -- → P3

Alex, patch failed to land.
Details: We're sorry, Autoland could not rebase your commits for you automatically. Please manually rebase your commits and try again. applying /tmp/tmpY5pttM dom/canvas/WebGLContextState.cpp Hunk #1 FAILED at 167. 1 out of 1 hunk FAILED -- saving rejects to file dom/canvas/WebGLContextState.cpp.rej abort: patch command failed: exited with status 256

Flags: needinfo?(alexhenrie24)

Looks like this was taken care of in Bug 1477756.

Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Flags: needinfo?(alexhenrie24)
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: