Ticket #47 (closed defect: fixed)
Unnecessary use of trailing null parameter in function calls
| Reported by: | JeremyRuston | Owned by: | JeremyRuston |
|---|---|---|---|
| Priority: | minor | Milestone: | 2.1 |
| Component: | core | Version: | |
| Severity: | low | Keywords: | |
| Cc: |
Description
There are a number of cases where trailing null parameters are unnecessarily used in function callse, eg createTiddlyElement(place,"ul",null,null,null);
is used rather than
createTiddlyElement(place,"ul");
As long as the strict equality (===) or strict inequality (!==) operators are not used in the called function, the above two are equivalent. In the TiddlyWiki core these operators are not used to check function parameters (there is only one use "window.hadConfirmExit === false"), so it is safe to make the replacement.
The easiest way to do this is a global replace of ",null)" by ")". It has to be performed 3 times, resulting in a total of 37 replacements and saving 185 bytes in the core TiddlyWiki file.
See this discussion.
