/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Tools/AnalyzerRunner/Statistic.cs
32 строки
1 KB
CyrusNajmabadi
Run 'make struct readonly' on compiler code (#63675)
31 авг 2022, 00:37
Не верифицирован
31 авг 2022, 00:37
4088142
Код
Авторство
О чём код?
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable namespace AnalyzerRunner { internal readonly struct Statistic { public Statistic(int numberOfNodes, int numberOfTokens, int numberOfTrivia) { this.NumberofNodes = numberOfNodes; this.NumberOfTokens = numberOfTokens; this.NumberOfTrivia = numberOfTrivia; } public int NumberofNodes { get; } public int NumberOfTokens { get; } public int NumberOfTrivia { get; } public static Statistic operator +(Statistic statistic1, Statistic statistic2) { return new Statistic( statistic1.NumberofNodes + statistic2.NumberofNodes, statistic1.NumberOfTokens + statistic2.NumberOfTokens, statistic1.NumberOfTrivia + statistic2.NumberOfTrivia); } } }