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

Function unique_pred

stackgl_modules/index.js:38852–38869  ·  view source on GitHub ↗
(list, compare)

Source from the content-addressed store, hash-verified

38850
38851
38852function unique_pred(list, compare) {
38853 var ptr = 1
38854 , len = list.length
38855 , a=list[0], b=list[0]
38856 for(var i=1; i<len; ++i) {
38857 b = a
38858 a = list[i]
38859 if(compare(a, b)) {
38860 if(i === ptr) {
38861 ptr++
38862 continue
38863 }
38864 list[ptr++] = a
38865 }
38866 }
38867 list.length = ptr
38868 return list
38869}
38870
38871function unique_eq(list) {
38872 var ptr = 1

Callers 1

uniqueFunction · 0.85

Calls 1

compareFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…