@@ -12,7 +12,6 @@ const { vtkErrorMacro, vtkWarningMacro } = macro;
12
12
let randomSeedValue = 0 ;
13
13
const VTK_MAX_ROTATIONS = 20 ;
14
14
const VTK_SMALL_NUMBER = 1.0e-12 ;
15
- const MAX_FUNCTION_ARGUMENTS = 32768 ;
16
15
17
16
function notImplemented ( method ) {
18
17
return ( ) => vtkErrorMacro ( `vtkMath::${ method } - NOT IMPLEMENTED` ) ;
@@ -45,25 +44,21 @@ const { round, floor, ceil, min, max } = Math;
45
44
46
45
function arrayMin ( arr ) {
47
46
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
+ }
54
51
}
55
52
56
53
return minValue ;
57
54
}
58
55
59
56
function arrayMax ( arr ) {
60
57
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
+ }
67
62
}
68
63
69
64
return maxValue ;
0 commit comments