soywiz-archive / jspspemu

typescript psp emulator https://jspspemu.soywiz.com/
https://soywiz.com/
97 stars 34 forks source link

Cache function calls #7

Open soywiz opened 10 years ago

soywiz commented 10 years ago

Instead of:

var func = function() {
    // code
    getFuncAddress(address)(...)
}
var func = (function() {
    var func1= null;
    var func2= null;
    return function() {
        // code
        if (func1 == null) func1 = getFuncAddress(address);
        func1();
    };
})()