Closed Bug 103443 Opened 25 years ago Closed 24 years ago

return rv?rv:NS_ERROR_FAILURE; looks ugly

Categories

(Core :: Layout, defect)

x86
Windows 98
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bernd_mozilla, Assigned: bernd_mozilla)

Details

Attachments

(4 files)

at http://lxr.mozilla.org/seamonkey/source/layout/html/table/src/nsTableRowGroupFrame.cpp#1734 the following code snippet can be found: if(NS_FAILED(rv) || !tempParentFrame) return rv?rv:NS_ERROR_FAILURE; this should look like: if (NS_FAILED(rv)) return rv; if (!tempParentFrame) return NS_ERROR_FAILURE; a search at lxr for rv?rv reveals more than 20 hits. I will attach a patch to bring this search down to zero.
sorry Marc, this should be my work
Assignee: attinasi → bernd.mielke
Comment on attachment 52380 [details] [diff] [review] the layout part of the work r=dbaron, although I would prefer if you put the return statements on a separate line, e.g. if (NS_FAILED(rv)) return rv; rather than if (NS_FAILED(rv)) return rv; mainly since that makes it easier to work with in a debugger.
Attachment #52380 - Flags: review+
Comment on attachment 52948 [details] [diff] [review] patch with Davids comments Except for the missing ')' on the line below, r=dbaron. >Index: html/base/src/nsTextFrame.cpp >+ if (NS_FAILED(rv)
Attachment #52948 - Flags: review+
Comment on attachment 52948 [details] [diff] [review] patch with Davids comments Make it compile, and sr=attinasi + if (NS_FAILED(rv)
Attachment #52948 - Flags: superreview+
Attached patch the editor part — — Splinter Review
Comment on attachment 53605 [details] [diff] [review] the editor part There are a couple of places where you made this change: - if (NS_FAILED(rv) || !aContent) - return rv?rv:NS_ERROR_FAILURE; - else + if (NS_FAILED(rv)) + return rv; + if (!aContent) + return NS_ERROR_FAILURE; + return NS_OK; Make sure you outdent the "return NS_OK;" that used to be under the "else". I probably would've made it look more like ... - if (NS_FAILED(rv) || !aContent) - return rv?rv:NS_ERROR_FAILURE; - else - return NS_OK; + if (!aContent) + return NS_ERROR_FAILURE; + + return rv; ... though that's not a requirement for checkin. Thanks for removing this pattern. It's been the source of several bugs in the past! sr=kin@netscape.com
Attachment #53605 - Flags: superreview+
The NS_OK is correctly indented in my source, I posted a diff -uw which may be confusing.
Comment on attachment 53605 [details] [diff] [review] the editor part Note that editor/base is supposed to be removed, so those changes don't need to be checked in. All editor files are in the libeditor and composer directories.
Attachment #53605 - Flags: review+
r=cmanske
Comment on attachment 54677 [details] [diff] [review] get rid of the remaining occurences sr=attinasi
Attachment #54677 - Flags: superreview+
Comment on attachment 54677 [details] [diff] [review] get rid of the remaining occurences r=kin@netscape.com
Attachment #54677 - Flags: review+
Comment on attachment 54677 [details] [diff] [review] get rid of the remaining occurences r=kin@netscape.com
fix checked in
Status: NEW → RESOLVED
Closed: 24 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: