Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion db.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ module.exports = function db (dir, keys, opts) {
var c = db.views[name].since.value
current += (Number.isInteger(c) ? c : -1)
}
prog.current = ~~(current / n)
// we use Math.floor to avoid overflow errors
prog.current = Math.floor(current / n)
// if the progress bar is complete, move the starting point
// up to the current position!
if (prog.start <= 0) {
Expand Down