Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why delete self._times[name]? #190

Open
janeluck opened this issue Oct 28, 2015 · 0 comments
Open

why delete self._times[name]? #190

janeluck opened this issue Oct 28, 2015 · 0 comments

Comments

@janeluck
Copy link

line 1323 in core.js

    p.startTimer = function(name, delay, callback)
    {
        var self = this;

        self.stopTimer(name);

        self._timers[name] = setTimeout(
            function()
            {
                delete self._timers[name];
                callback.apply(self);
            },
            delay * 1000
        );
    };

I am puzzled when i read source code, It is ok when i remove this line.
why do delete? Is about high performance?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant