Antlr4.Codegen.Model.ElementFrequenciesVisitor.CombineMax C# (CSharp) Метод

CombineMax() защищенный статический Метод

protected static CombineMax ( FrequencySet a, FrequencySet b ) : FrequencySet
a FrequencySet
b FrequencySet
Результат FrequencySet
        protected static FrequencySet<string> CombineMax(FrequencySet<string> a, FrequencySet<string> b)
        {
            FrequencySet<string> result = CombineAndClip(a, b, 1);
            foreach (KeyValuePair<string, StrongBox<int>> entry in a)
            {
                result[entry.Key].Value = entry.Value.Value;
            }

            foreach (KeyValuePair<string, StrongBox<int>> entry in b)
            {
                StrongBox<int> slot = result[entry.Key];
                slot.Value = Math.Max(slot.Value, entry.Value.Value);
            }

            return result;
        }