Open
Description
In Espruino we have quite a few functions that do multiple things...
eg:
jsvObjectSetChild(obj, "name", child);
jsvUnLock(child);
turns into:
jsvObjectSetChildAndUnLock(obj, "name", child);
Which for something that's used a lot can end up saving an awful lot of flash.
Ideally we should be able to have a list of these, and then run over the code and detect when code exists that uses the first pattern when it should use the second.
We have ... make lst; scripts/find_common_code.js bin/projectname.lst
at the moment which looks at the final built code and has helped to detect glaring issues, but this doesn't stop new uses of the old pattern coming in which over time can add up to waste a lot of space.