Closed Bug 620420 Opened 14 years ago Closed 9 years ago

jsds_InvalidateAllEphemerals can use a do {} while() loop

Categories

(Core :: JavaScript Engine, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: timeless, Assigned: timeless)

References

(Blocks 1 open bug)

Details

(Keywords: coverity, Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

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 }
Attached patch patchSplinter Review
Assignee: nobody → timeless
Status: NEW → ASSIGNED
Attachment #498913 - Flags: review?(brendan)
Attachment #498913 - Flags: review?(brendan) → review+
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
https://hg.mozilla.org/mozilla-central/rev/6aea1d08ce37
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: