Skip to content

Commit 22ba1af

Browse files
committed
Remove math.floor
1 parent a6ddef1 commit 22ba1af

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

block_reader.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ BlockReader.prototype.read_async_cb = function (Vh) {
6767
var block_number, l, we, cache_block, i, Wh, sector_buf, Yh, cache_buf;
6868
var ai, Ig;
6969
while (this.sector_index < this.sector_count) {
70-
block_number = Math.floor(this.sector_num / this.block_sectors);
70+
block_number = (this.sector_num / this.block_sectors)|0;
7171
cache_block = this.get_cached_block(block_number);
7272
if (cache_block) {
7373
we = this.sector_num - block_number * this.block_sectors;
@@ -115,7 +115,7 @@ BlockReader.prototype.read_async_cb2 = function (data, data_len) {
115115
return;
116116
}
117117

118-
block_number = Math.floor(this.sector_num / this.block_sectors);
118+
block_number = (this.sector_num / this.block_sectors)|0;
119119
this.add_block(block_number, data, data_len);
120120
this.read_async_cb(false);
121121

pit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function PIT_channel(get_ticks) {
1212
this.pit_time_unit = 1193182 / 2000000;
1313
}
1414
PIT_channel.prototype.get_time = function () {
15-
return Math.floor(this.get_ticks() * this.pit_time_unit);
15+
return (this.get_ticks() * this.pit_time_unit)|0;
1616
};
1717
PIT_channel.prototype.pit_get_count = function () {
1818
var d, fh;

0 commit comments

Comments
 (0)