@@ -1022,22 +1022,24 @@ namespace NCB {
1022
1022
const auto catFeatureIdx =
1023
1023
featuresLayout->GetInternalFeatureIdx <EFeatureType::Categorical>(externalFeatureIdx);
1024
1024
1025
- const auto & srcCatFeaturePerfectHash =
1026
- quantizedFeaturesInfo->GetCategoricalFeaturesPerfectHash (catFeatureIdx);
1027
-
1028
- TMap<ui32, TValueWithCount> dstCatFeaturePerfectHash = srcCatFeaturePerfectHash.Map ;
1029
- if (srcCatFeaturePerfectHash.DefaultMap .Defined ()) {
1030
- dstCatFeaturePerfectHash.emplace (
1031
- srcCatFeaturePerfectHash.DefaultMap ->SrcValue ,
1032
- srcCatFeaturePerfectHash.DefaultMap ->DstValueWithCount
1033
- );
1034
- }
1025
+ TMap<ui32, TValueWithCount> dstCatFeaturePerfectHash;
1035
1026
1036
1027
TMaybeData<const IQuantizedCatValuesHolder*> feature =
1037
1028
quantizedObjectsData->GetCatFeature (*catFeatureIdx);
1038
1029
1039
1030
THolder<TSrcColumnBase> maybeFeatureColumn;
1040
1031
if (feature) {
1032
+ const auto & srcCatFeaturePerfectHash =
1033
+ quantizedFeaturesInfo->GetCategoricalFeaturesPerfectHash (catFeatureIdx);
1034
+
1035
+ dstCatFeaturePerfectHash = srcCatFeaturePerfectHash.Map ;
1036
+ if (srcCatFeaturePerfectHash.DefaultMap .Defined ()) {
1037
+ dstCatFeaturePerfectHash.emplace (
1038
+ srcCatFeaturePerfectHash.DefaultMap ->SrcValue ,
1039
+ srcCatFeaturePerfectHash.DefaultMap ->DstValueWithCount
1040
+ );
1041
+ }
1042
+
1041
1043
if (dstCatFeaturePerfectHash.size () > ((size_t )Max<ui16>() + 1 )) {
1042
1044
maybeFeatureColumn = GenerateSrcColumn<ui32>(**feature);
1043
1045
} else if (dstCatFeaturePerfectHash.size () > ((size_t )Max<ui8>() + 1 )) {
0 commit comments