JScrewIt icon indicating copy to clipboard operation
JScrewIt copied to clipboard

optimization for fromCharCode usage

Open Clayblockunova opened this issue 3 years ago • 2 comments

Currently, when fromCharCode or fromCodePoint is used, the whole string is converted into decimal codepoint even if the string begin or ended with simple characters (numbers, 'N','a','d','e','f','i','l','n','r','s','t','u'). Using "+" to attach those simple characters on head or end of string genetated by fromCharCode can shorten generated code.

Clayblockunova avatar Jan 28 '22 10:01 Clayblockunova

I think I understand what you mean, but could you please post an example here, just to be sure?

fasttime avatar Jan 28 '22 13:01 fasttime

currently, "f中中" cost 5568 chars, but "f"+"中中" only cost 5237 chars.

Clayblockunova avatar Jan 28 '22 16:01 Clayblockunova