do {} while (PR_FALSE); seems rewritable

RESOLVED INCOMPLETE

Status

()

Core
Layout: Misc Code
RESOLVED INCOMPLETE
18 years ago
3 years ago

People

(Reporter: timeless, Assigned: timeless)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment, 1 obsolete attachment)

Comment hidden (empty)
(Assignee)

Comment 1

18 years ago
Created attachment 25685 [details] [diff] [review]
clean out do while loop
(Assignee)

Comment 2

18 years ago
Created attachment 25686 [details] [diff] [review]
better patch
My only concern here is that it changes the flow of code, using returns instead
of breaks.  The do {} while(PR_FALSE) is being used here as a poor man's
exception routine.  A goto might work just as well if you want to skip ahead in
the case of a failure.

In any case, I'm not sure what the effect of the change in flow will be because
I can't see the surrounding code.  Waterson, layout is your favorite playground.
 Want to have a look?

Comment 4

18 years ago
Why is this better?

Comment 5

18 years ago
> A goto might work just as well if you want to skip ahead in the case of a failure.

Please don't use gotos to skip over code that contains nsCOMPtrs, or other C++
isms. You'll get compiler warnings at best, or crash at worst.
(Assignee)

Comment 6

18 years ago
it took me a long time to understand what the while loop's purpose was.  early 
returns otoh are easily understood. [i'll attach a new patch w/ more cleanup]
Keywords: review
Attachment #25685 - Attachment is obsolete: true
timeless, why are you working on bugs that are way past mozilla1.0 in any
conceivable setting of their Target Milestones?  Please help with the crucial stuff.

/be
I misread the year in that date on timeless's last comment -- timeless, please
accept my apologies.  Sorry about that, I have something of a hair trigger
around you on 1.0 non-priorities and I just shot my own foot!

/be
->misc code
Component: Layout → Layout: Misc Code
QA Contact: chrispetersen → layout.misc-code

Updated

3 years ago
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.