MCPcopy Index your code
hub / github.com/microsoft/SandDance / extentIndex

Function extentIndex

docs/app/js/sanddance-app.js:106842–106902  ·  view source on GitHub ↗
(array3, f)

Source from the content-addressed store, hash-verified

106840 ];
106841}
106842function extentIndex(array3, f) {
106843 const n = array3.length;
106844 let i = -1, a, b, c, u, v;
106845 if (f == null) {
106846 while(++i < n){
106847 b = array3[i];
106848 if (b != null && b >= b) {
106849 a = c = b;
106850 break;
106851 }
106852 }
106853 if (i === n) return [
106854 -1,
106855 -1
106856 ];
106857 u = v = i;
106858 while(++i < n){
106859 b = array3[i];
106860 if (b != null) {
106861 if (a > b) {
106862 a = b;
106863 u = i;
106864 }
106865 if (c < b) {
106866 c = b;
106867 v = i;
106868 }
106869 }
106870 }
106871 } else {
106872 while(++i < n){
106873 b = f(array3[i], i, array3);
106874 if (b != null && b >= b) {
106875 a = c = b;
106876 break;
106877 }
106878 }
106879 if (i === n) return [
106880 -1,
106881 -1
106882 ];
106883 u = v = i;
106884 while(++i < n){
106885 b = f(array3[i], i, array3);
106886 if (b != null) {
106887 if (a > b) {
106888 a = b;
106889 u = i;
106890 }
106891 if (c < b) {
106892 c = b;
106893 v = i;
106894 }
106895 }
106896 }
106897 }
106898 return [
106899 u,

Callers

nothing calls this directly

Calls 1

fFunction · 0.70

Tested by

no test coverage detected