MCPcopy Index your code
hub / github.com/plotly/plotly.js / unique

Function unique

stackgl_modules/index.js:35867–35885  ·  view source on GitHub ↗
(cells)

Source from the content-addressed store, hash-verified

35865
35866//Removes all duplicate cells in the complex
35867function unique(cells) {
35868 if(cells.length === 0) {
35869 return []
35870 }
35871 var ptr = 1
35872 , len = cells.length
35873 for(var i=1; i<len; ++i) {
35874 var a = cells[i]
35875 if(compareCells(a, cells[i-1])) {
35876 if(i === ptr) {
35877 ptr++
35878 continue
35879 }
35880 cells[ptr++] = a
35881 }
35882 }
35883 cells.length = ptr
35884 return cells
35885}
35886__webpack_unused_export__ = unique;
35887
35888//Finds a cell in a normalized cell complex

Callers 2

dualFunction · 0.85

Calls 3

compareCellsFunction · 0.85
unique_predFunction · 0.85
unique_eqFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…