Closed xem closed 7 years ago
You mean you do not have any initialization code ? That is, code that is run once before entering the loop. Is is an example from a real demo ?
I did not expect that case to happen, but it should be easy to solve.
My real-life demo is very near from the example I sent above:
t=0;setInterval(function(){t?play():init();t++},33)
(with "play()" and "init()" replaced by big chunks of code.)
unfortunately, this packs as:
for(_='if(!t){}t?play():init();t++';G=/[]/.exec(_);)with(_.split(G))_=join(shift(t=0));setInterval(_,33)
I'm not asking you to support ternaries a?b:c
, but if you could remove the if(!t){}
fragment when the braces are empty, that'd be great.
Removed the code if(!f){}
if there is no initialization code, neither at the beginning nor the end.
Adapted thermal view as well.
Packing this example code with setInterval refactor and loop var "t":
preprocessed code is:
should be simplified to:
packed code is:
should be simplified to:
cheers!