Skip to content

Commit 2124ceb

Browse files
committed
bind is actually faster not lazy
1 parent 0eaae27 commit 2124ceb

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

dist/happy-0.0.1.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/utils.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,13 @@ var off = function(el, ev, callback) {
2828

2929
var bind = function(func, obj) {
3030
if (func.bind) {
31-
bind = function(func, obj) {
32-
return func.bind(obj);
33-
};
31+
return func.bind(obj);
3432
}
3533
else {
36-
bind = function(func, obj) {
37-
return function() {
38-
return func.apply(obj, arguments);
39-
};
34+
return function(func, obj) {
35+
return func.apply(obj, arguments);
4036
};
4137
}
42-
return bind(func, obj);
4338
};
4439

4540
var attr = function(elem, attrs) {

0 commit comments

Comments
 (0)