Closed Bug 1312451 Opened 8 years ago Closed 8 years ago

Get rid of unnecessary empty lines under editor/txmgr

Categories

(Core :: DOM: Editor, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox52 --- fixed

People

(Reporter: masayuki, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

cpp files in editor/txmgr have a lot of empty lines which look very redundant. For example: > nsresult rv = Foo(); > > NS_ENSURE_SUCCESS(rv, rv); Why do we need the middle empty line? The error check is for the first line, so, without the empty line looks like "a" block that indicates that these lines are related clearer.
Comment on attachment 8804254 [details] Bug 1312451 Remove unnecessary empty line from .cpp files under editor/txmgr https://reviewboard.mozilla.org/r/88320/#review87380 ::: editor/txmgr/nsTransactionManager.cpp:650 (Diff revision 1) > nsISupports *aData) > { > // XXX: POSSIBLE OPTIMIZATION > // We could use a factory that pre-allocates/recycles transaction items. > RefPtr<nsTransactionItem> tx = new nsTransactionItem(aTransaction); > + if (!tx) { Well, isn't the check useless, since 'new' is infallible. But fine, doesn't really matter.
Attachment #8804254 - Flags: review?(bugs) → review+
Comment on attachment 8804254 [details] Bug 1312451 Remove unnecessary empty line from .cpp files under editor/txmgr https://reviewboard.mozilla.org/r/88320/#review87380 > Well, isn't the check useless, since 'new' is infallible. But fine, doesn't really matter. Indeed, however, we still check |new| result in a lot of places. Why? If we could remove them, our code size would be really smaller and simpler than now. Do you know if we had some discussion about that?
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/fb63f946445b Remove unnecessary empty line from .cpp files under editor/txmgr r=smaug
I think it was bsmedberg who was driving the infallible memory allocation stuff. Maybe he or froydnj has some feedback whether we should start consistently remove any useless OOM checks.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
(In reply to Olli Pettay [:smaug] (vacation Nov 19-26) from comment #6) > I think it was bsmedberg who was driving the infallible memory allocation > stuff. > Maybe he or froydnj has some feedback whether we should start consistently > remove any useless OOM checks. Thanks, I emailed to dev-platform with ccing bsmedberg.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: