since globalDiscardedFeatureIndices is passed by reference, no need to clear it now