From: Seoyeon2Kim <34738918+Seoyeon2Kim@users.noreply.github.com> Date: Thu, 3 Dec 2020 05:49:53 +0000 (+0900) Subject: [NUI] Fix a build warning CA1827 (#2314) X-Git-Tag: accepted/tizen/unified/20210219.040944~225 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fe83bdbc14c80d83b2e4e4647a7fa5405e7b95eb;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Fix a build warning CA1827 (#2314) - Changed to use `Count()` method once for a local variable. Then, we do not have to be worried about CA1827. - To fix the build warning, it could replace `Count()` method with `Any()` method https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1827 - But, to improve performance as a review, use `Count()` itself. Signed-off-by: Seoyeon Kim --- diff --git a/src/Tizen.NUI/src/public/BaseComponents/ControlState.cs b/src/Tizen.NUI/src/public/BaseComponents/ControlState.cs index 205b88d..352ee06 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ControlState.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ControlState.cs @@ -285,13 +285,14 @@ namespace Tizen.NUI.BaseComponents } var rest = lhs.stateList.Except(rhs.stateList); + var count = rest.Count(); - if (rest.Count() == 0) + if (count == 0) { return Normal; } - if (rest.Count() == 1) + if (count == 1) { return rest.First(); }