jsds_InvalidateAllEphemerals can use a do {} while() loop

RESOLVED FIXED

Status

()

Core
JavaScript Engine
--
enhancement
RESOLVED FIXED
8 years ago
14 days ago

People

(Reporter: timeless, Assigned: timeless)

Tracking

(Blocks: 1 bug, {coverity})

Trunk
coverity
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 attachment)

(Assignee)

Description

8 years ago
195 jsds_InvalidateAllEphemerals (LiveEphemeral **listHead)
196 {

since we dereference listHead here:
197     LiveEphemeral *lv_record = 
198         reinterpret_cast<LiveEphemeral *>
199                         (PR_NEXT_LINK(&(*listHead)->links));

we don't need to check *listHead the first time through the loop:
200     while (*listHead)
201     {
202         LiveEphemeral *next =
203             reinterpret_cast<LiveEphemeral *>
204                             (PR_NEXT_LINK(&lv_record->links));
205         lv_record->value->Invalidate();
206         lv_record = next;
207     }
208 }
(Assignee)

Comment 1

8 years ago
Created attachment 498913 [details] [diff] [review]
patch
Assignee: nobody → timeless
Status: NEW → ASSIGNED
Attachment #498913 - Flags: review?(brendan)
Attachment #498913 - Flags: review?(brendan) → review+
(Assignee)

Updated

8 years ago
Keywords: checkin-needed
Whiteboard: [push to tm]
http://hg.mozilla.org/tracemonkey/rev/6aea1d08ce37
Keywords: checkin-needed
Whiteboard: [push to tm] → fixed-in-tracemonkey
Component: JavaScript Debugging/Profiling APIs → JavaScript Engine
Product: Core → Core
https://hg.mozilla.org/mozilla-central/rev/6aea1d08ce37
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.