memory-pager
Advanced tools
Comparing version 1.2.0 to 1.3.0
10
index.js
@@ -14,2 +14,10 @@ module.exports = Pager | ||
Pager.prototype.updated = function (page) { | ||
while (this.deduplicate && page.buffer[page.deduplicate] === this.deduplicate[page.deduplicate]) { | ||
page.deduplicate++ | ||
if (page.deduplicate === this.deduplicate.length) { | ||
page.deduplicate = 0 | ||
if (page.buffer.equals && page.buffer.equals(this.deduplicate)) page.buffer = this.deduplicate | ||
break | ||
} | ||
} | ||
if (page.updated || !this.updates) return | ||
@@ -42,2 +50,3 @@ page.updated = true | ||
page.buffer = copy(page.buffer) | ||
page.deduplicate = 0 | ||
} | ||
@@ -114,2 +123,3 @@ | ||
this.updated = false | ||
this.deduplicate = 0 | ||
} |
{ | ||
"name": "memory-pager", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "Access memory using small fixed sized buffers", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
7318
154