MCPcopy Create free account
hub / github.com/breck7/scroll / _areAllUnique

Function _areAllUnique

external/.datatables.js:1261–1278  ·  view source on GitHub ↗
(src)

Source from the content-addressed store, hash-verified

1259 * @ignore
1260 */
1261 var _areAllUnique = function (src) {
1262 if (src.length < 2) {
1263 return true
1264 }
1265
1266 var sorted = src.slice().sort()
1267 var last = sorted[0]
1268
1269 for (var i = 1, ien = sorted.length; i < ien; i++) {
1270 if (sorted[i] === last) {
1271 return false
1272 }
1273
1274 last = sorted[i]
1275 }
1276
1277 return true
1278 }
1279
1280 /**
1281 * Find the unique elements in a source array.

Callers 1

_uniqueFunction · 0.85

Calls 2

sortMethod · 0.80
sliceMethod · 0.80

Tested by

no test coverage detected