cemyuksel / cyCodeBase

An open source programming resource intended for graphics programmers.
MIT License
271 stars 60 forks source link

MinID / MaxID of cy::Point #7

Closed xarthurx closed 5 years ago

xarthurx commented 5 years ago
    int   MinID        () const { TYPE m = data[0]; int ix=0; for ( int i=1; i<N; ++i ) if ( m > data[i] ) { m = data[i]; ix = i; } return m; }
    int   MaxID        () const { TYPE m = data[0]; int ix=0; for ( int i=1; i<N; ++i ) if ( m < data[i] ) { m = data[i]; ix = i; } return m; }

Should these two functions return ix instead of return m? Otherwise, it will be the same function as Min/Max in the header file.

cemyuksel commented 5 years ago

That's right! Thanks for pointing them out. These methods are now fixed.