@@ -12,7 +12,6 @@ const { vtkErrorMacro, vtkWarningMacro } = macro;
1212let randomSeedValue = 0 ;
1313const VTK_MAX_ROTATIONS = 20 ;
1414const VTK_SMALL_NUMBER = 1.0e-12 ;
15- const MAX_FUNCTION_ARGUMENTS = 32768 ;
1615
1716function notImplemented ( method ) {
1817 return ( ) => vtkErrorMacro ( `vtkMath::${ method } - NOT IMPLEMENTED` ) ;
@@ -45,25 +44,21 @@ const { round, floor, ceil, min, max } = Math;
4544
4645function arrayMin ( arr ) {
4746 let minValue = Infinity ;
48- for ( let i = 0 , len = arr . length ; i < len ; i += MAX_FUNCTION_ARGUMENTS ) {
49- const submin = Math . min . apply (
50- null ,
51- arr . slice ( i , Math . min ( i + MAX_FUNCTION_ARGUMENTS , len ) )
52- ) ;
53- minValue = Math . min ( submin , minValue ) ;
47+ for ( let i = 0 , len = arr . length ; i < len ; ++ i ) {
48+ if ( arr [ i ] < minValue ) {
49+ minValue = arr [ i ] ;
50+ }
5451 }
5552
5653 return minValue ;
5754}
5855
5956function arrayMax ( arr ) {
6057 let maxValue = - Infinity ;
61- for ( let i = 0 , len = arr . length ; i < len ; i += MAX_FUNCTION_ARGUMENTS ) {
62- const submax = Math . max . apply (
63- null ,
64- arr . slice ( i , Math . min ( i + MAX_FUNCTION_ARGUMENTS , len ) )
65- ) ;
66- maxValue = Math . max ( submax , maxValue ) ;
58+ for ( let i = 0 , len = arr . length ; i < len ; ++ i ) {
59+ if ( arr [ i ] > maxValue ) {
60+ maxValue = arr [ i ] ;
61+ }
6762 }
6863
6964 return maxValue ;
0 commit comments