mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 08:12:05 +00:00
2773c4d0ef
In our coding rules, variable names of nsresult should be rv. Indeed, when you see |rv| in the code, you must assume that its type if nsresult. However, a lot of code under editor/ uses |res| for the variables of nsresult. Let's replace |res| with |rv|. And this patch improves following points: 1. When |rv| is set in both |if| and |else| block and they are check outside of them, this moves the check into each |if| and |else| block because even if the failure is notified with warning, you cannot see which case was performed and failed. This change makes it clear. 2. When |return rv;| returns non-error code because |rv| is checked with NS_ENSURE_SUCCESS() immediately before, setting replacing it with |return NS_OK;| is clearer. 3. Move declaration of |nsresult rv| into smaller scope as far as possible. This prevents setting rv to unexpected value and easier to check its value at reading the code. MozReview-Commit-ID: 9MAqj7sFey3 --HG-- extra : rebase_source : 0fd316b851ea616b3a95d8c1afc111ff55e11993 |
||
---|---|---|
.. | ||
composer | ||
libeditor | ||
reftests | ||
txmgr | ||
txtsvc | ||
AsyncSpellCheckTestHelper.jsm | ||
moz.build | ||
nsEditorCID.h | ||
nsIContentFilter.idl | ||
nsIDocumentStateListener.idl | ||
nsIEditActionListener.idl | ||
nsIEditor.idl | ||
nsIEditorIMESupport.idl | ||
nsIEditorMailSupport.idl | ||
nsIEditorObserver.idl | ||
nsIEditorSpellCheck.idl | ||
nsIEditorStyleSheets.idl | ||
nsIEditorUtils.idl | ||
nsIHTMLAbsPosEditor.idl | ||
nsIHTMLEditor.idl | ||
nsIHTMLInlineTableEditor.idl | ||
nsIHTMLObjectResizeListener.idl | ||
nsIHTMLObjectResizer.idl | ||
nsIPlaintextEditor.idl | ||
nsITableEditor.idl | ||
nsIURIRefObject.idl | ||
nsPIEditorTransaction.idl |