Skip to content

Commit

Permalink
Code gardening (#283)
Browse files Browse the repository at this point in the history
  • Loading branch information
sailro authored May 30, 2023
1 parent b20660e commit 919faae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/Microsoft.Unity.Analyzers/BaseVectorConversion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Operations;
using Microsoft.CodeAnalysis.Simplification;

namespace Microsoft.Unity.Analyzers;

Expand Down
15 changes: 7 additions & 8 deletions src/Microsoft.Unity.Analyzers/ScriptInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,13 @@ public IEnumerable<MethodInfo> GetNotImplementedMessages(Accessibility? accessib

private static bool AccessibilityMatch(MethodInfo message, Accessibility accessibility)
{
// If the message is declared as public or protected we need to honor it, other messages can be anything
if (message.IsPublic && message.IsVirtual)
return accessibility == Accessibility.Public;

if (message.IsFamily && message.IsVirtual)
return accessibility == Accessibility.Protected;

return true;
return message switch
{
// If the message is declared as public or protected we need to honor it, other messages can be anything
{ IsPublic: true, IsVirtual: true } => accessibility == Accessibility.Public,
{ IsFamily: true, IsVirtual: true } => accessibility == Accessibility.Protected,
_ => true
};
}

private bool IsImplemented(MethodInfo method)
Expand Down

0 comments on commit 919faae

Please sign in to comment.