if min value is really equals to the std::numeric_limits< int >().max() you will run min-max search each time from beginning