made sure Gini index works with more than 2^16 (65k) samples.
avoids checking all K features when constant (pure) node is found.