Skip to content

Commit 167ae7c

Browse files
author
Ilya Lebedev
committed
code cleanup
1 parent de93a9d commit 167ae7c

File tree

1 file changed

+7
-18
lines changed

1 file changed

+7
-18
lines changed

lib/FileAPI.core.js

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,15 @@
3838
_rdata = /^data:[^,]+,/,
3939

4040
_pow = Math.pow,
41+
_round = Math.round,
42+
_num = Number,
4143
_from = function (sz) {
42-
return Math.round(sz * this);
44+
return _round(sz * this);
4345
},
44-
_KB = new Number(1024),
45-
_MB = new Number(_pow(_KB, 2)),
46-
_GB = new Number(_pow(_KB, 3)),
47-
_TB = new Number(_pow(_KB, 4)),
46+
_KB = new _num(1024),
47+
_MB = new _num(_pow(_KB, 2)),
48+
_GB = new _num(_pow(_KB, 3)),
49+
_TB = new _num(_pow(_KB, 4)),
4850

4951
_elEvents = {}, // element event listeners
5052
_infoReader = [], // list of file info processors
@@ -75,19 +77,6 @@
7577
GB: (_GB.from = _from, _GB),
7678
TB: (_TB.from = _from, _TB),
7779

78-
toKB : function (sz) {
79-
return Math.round(sz * this.KB);
80-
},
81-
toMB : function (sz) {
82-
return Math.round(sz * this.MB);
83-
},
84-
toGB : function (sz) {
85-
return Math.round(sz * this.GB);
86-
},
87-
toTB : function (sz) {
88-
return Math.round(sz * this.TB);
89-
},
90-
9180
expando: 'fileapi' + (new Date).getTime(),
9281

9382
uid: function (obj){

0 commit comments

Comments
 (0)