Skip to content

Commit

Permalink
Use {} for hardlink tracking instead of []
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed May 15, 2019
1 parent 15e59f1 commit 9fc84b9
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions lib/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function Parse () {
me._stream = new BlockStream(512)
me.position = 0
me._ended = false
me._hardLinks = []
me._hardLinks = {}

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

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

if (entry.type === "File") {
this._hardLinks.forEach(function(link) {
if (link.path === entry.path) {
ev = "ignoredEntry"
}
})
if (entry.type === "File" && this._hardLinks[entry.path]) {
ev = "ignoredEntry"
}

this._entry = entry

if (entry.type === "Link") {
this._hardLinks.push(entry)
this._hardLinks[entry.path] = entry
}

var me = this
Expand Down

0 comments on commit 9fc84b9

Please sign in to comment.