Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
Use size 0 instead of null for key set links
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamStone committed Jun 5, 2016
1 parent 094dc2d commit 742f341
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/ipfs/pinner-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ exports = module.exports = function (dagS) {
var rootLinks = []
var i
for (i = 0; i < defaultFanout; i++) {
rootLinks.push(new DAGLink('', null, emptyKey))
rootLinks.push(new DAGLink('', 0, emptyKey))
}
logInternalKey(emptyKey)

Expand All @@ -134,7 +134,7 @@ exports = module.exports = function (dagS) {
var itemData = []
var indices = []
for (i = 0; i < items.length; i++) {
itemLinks.push(new DAGLink('', null, items[i].key))
itemLinks.push(new DAGLink('', 0, items[i].key))
itemData.push(items[i].data || new Buffer([]))
indices.push(i)
}
Expand All @@ -147,7 +147,7 @@ exports = module.exports = function (dagS) {
var sortedData = indices.map((i) => { return itemData[i] })
rootLinks = rootLinks.concat(sortedLinks)
rootData = Buffer.concat([rootData].concat(sortedData))
readHeader(new DAGNode(rootData, rootLinks)) //
readHeader(new DAGNode(rootData, rootLinks))
return callback(null, new DAGNode(rootData, rootLinks))
} else {
// need to split up the items into multiple root nodes
Expand Down

0 comments on commit 742f341

Please sign in to comment.