MCPcopy Index your code
hub / github.com/dataease/SQLBot / maxFactory

Function maxFactory

frontend/public/swagger-ui-bundle.js:3561–3576  ·  view source on GitHub ↗
(s, o, i)

Source from the content-addressed store, hash-verified

3559 )
3560 }
3561 function maxFactory(s, o, i) {
3562 if ((o || (o = defaultComparator), i)) {
3563 var a = s
3564 .toSeq()
3565 .map(function (o, a) {
3566 return [o, i(o, a, s)]
3567 })
3568 .reduce(function (s, i) {
3569 return maxCompare(o, s[1], i[1]) ? i : s
3570 })
3571 return a && a[0]
3572 }
3573 return s.reduce(function (s, i) {
3574 return maxCompare(o, s, i) ? i : s
3575 })
3576 }
3577 function maxCompare(s, o, i) {
3578 var a = s(i, o)
3579 return (0 === a && i !== o && (null == i || i != i)) || a > 0

Callers 1

Calls 4

maxCompareFunction · 0.85
iFunction · 0.70
reduceMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected