Unnecessary use of trailing null parameter in function calls

0 views
Skip to first unread message

Martin Budden

unread,
May 29, 2006, 4:06:42 PM5/29/06
to TiddlyWikiDev
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.

Martin

Jeremy Ruston

unread,
May 30, 2006, 5:26:34 AM5/30/06
to Tiddly...@googlegroups.com
Excellent suggestion, I've created a ticket for it:

http://trac.tiddlywiki.org/tiddlywiki/ticket/47

Cheers

Jeremy


--
Jeremy Ruston
mailto:jer...@osmosoft.com
http://www.tiddlywiki.com

Reply all
Reply to author
Forward
0 new messages