Skip to content

Commit

Permalink
fix: Don't use an unnecessary iterator (#1419)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikehazell authored Nov 9, 2021
1 parent 8e3886d commit 95c3b7c
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions src/store/modules/segmentationModule/getSegmentsOnPixeldata.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,5 @@
* @param {UInt16Array|Float32Array} pixelData The pixel data array.
*/
export default function getSegmentsOnPixelData(pixelData) {
const segmentSet = new Set(pixelData);
const iterator = segmentSet.values();

const segmentsOnLabelmap = [];
let done = false;

while (!done) {
const next = iterator.next();

done = next.done;

if (!done) {
segmentsOnLabelmap.push(next.value);
}
}

return segmentsOnLabelmap;
return [...new Set(pixelData)];
}

0 comments on commit 95c3b7c

Please sign in to comment.