@effect/data
Advanced tools
Comparing version 0.3.0 to 0.3.1
40
Chunk.js
@@ -181,3 +181,3 @@ "use strict"; | ||
} else { | ||
if (this.right.depth >= that.left.depth) { | ||
if (that.right.depth >= that.left.depth) { | ||
const nl = concat(that.left)(this); | ||
@@ -274,23 +274,19 @@ return new ChunkImpl({ | ||
const copyToArray = (self, array, initial) => { | ||
const toProcess = [[self, initial]]; | ||
while (toProcess.length > 0) { | ||
const [chunk, n] = toProcess.pop(); | ||
switch (chunk.backing._tag) { | ||
case "IArray": | ||
{ | ||
copy(chunk.backing.array, 0, array, n, chunk.length); | ||
break; | ||
} | ||
case "IConcat": | ||
{ | ||
toProcess.push([chunk.right, n + chunk.left.length]); | ||
toProcess.push([chunk.left, n]); | ||
break; | ||
} | ||
case "ISingleton": | ||
{ | ||
array[n] = chunk.backing.a; | ||
break; | ||
} | ||
} | ||
switch (self.backing._tag) { | ||
case "IArray": | ||
{ | ||
copy(self.backing.array, 0, array, initial, self.length); | ||
break; | ||
} | ||
case "IConcat": | ||
{ | ||
copyToArray(self.left, array, initial); | ||
copyToArray(self.right, array, initial + self.left.length); | ||
break; | ||
} | ||
case "ISingleton": | ||
{ | ||
array[initial] = self.backing.a; | ||
break; | ||
} | ||
} | ||
@@ -297,0 +293,0 @@ }; |
{ | ||
"name": "@effect/data", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -195,3 +195,2 @@ /** | ||
} | ||
case "ISingleton": { | ||
@@ -313,3 +312,3 @@ this.length = 1 | ||
} else { | ||
if (this.right.depth >= that.left.depth) { | ||
if (that.right.depth >= that.left.depth) { | ||
const nl = concat(that.left)(this) | ||
@@ -387,22 +386,16 @@ return new ChunkImpl({ _tag: "IConcat", left: nl, right: that.right }) | ||
const copyToArray = <A>(self: Chunk<A>, array: Array<any>, initial: number): void => { | ||
const toProcess: Array<[Chunk<any>, number]> = [[self, initial]] | ||
while (toProcess.length > 0) { | ||
const [chunk, n] = toProcess.pop()! | ||
switch (chunk.backing._tag) { | ||
case "IArray": { | ||
copy(chunk.backing.array, 0, array, n, chunk.length) | ||
break | ||
} | ||
case "IConcat": { | ||
toProcess.push([chunk.right, n + chunk.left.length]) | ||
toProcess.push([chunk.left, n]) | ||
break | ||
} | ||
case "ISingleton": { | ||
array[n] = chunk.backing.a | ||
break | ||
} | ||
switch (self.backing._tag) { | ||
case "IArray": { | ||
copy(self.backing.array, 0, array, initial, self.length) | ||
break | ||
} | ||
case "IConcat": { | ||
copyToArray(self.left, array, initial) | ||
copyToArray(self.right, array, initial + self.left.length) | ||
break | ||
} | ||
case "ISingleton": { | ||
array[initial] = self.backing.a | ||
break | ||
} | ||
} | ||
@@ -409,0 +402,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3362197
74470