Skip to content

Commit 9fc84b9

Browse files
committed
Use {} for hardlink tracking instead of []
1 parent 15e59f1 commit 9fc84b9

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

lib/parse.js

+4-8
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function Parse () {
3838
me._stream = new BlockStream(512)
3939
me.position = 0
4040
me._ended = false
41-
me._hardLinks = []
41+
me._hardLinks = {}
4242

4343
me._stream.on("error", function (e) {
4444
me.emit("error", e)
@@ -251,18 +251,14 @@ Parse.prototype._startEntry = function (c) {
251251

252252
if (onend) entry.on("end", onend)
253253

254-
if (entry.type === "File") {
255-
this._hardLinks.forEach(function(link) {
256-
if (link.path === entry.path) {
257-
ev = "ignoredEntry"
258-
}
259-
})
254+
if (entry.type === "File" && this._hardLinks[entry.path]) {
255+
ev = "ignoredEntry"
260256
}
261257

262258
this._entry = entry
263259

264260
if (entry.type === "Link") {
265-
this._hardLinks.push(entry)
261+
this._hardLinks[entry.path] = entry
266262
}
267263

268264
var me = this

0 commit comments

Comments
 (0)