Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/Compilers/Core/Portable/RuleSet/RuleSetInclude.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ public RuleSet LoadRuleSet(RuleSet parent)
try
{
path = GetIncludePath(parent);
if (path == null)
{
return null;
}

ruleSet = RuleSetProcessor.LoadFromFile(path);
}
catch (FileNotFoundException)
Expand All @@ -78,11 +83,9 @@ public RuleSet LoadRuleSet(RuleSet parent)
private string GetIncludePath(RuleSet parent)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there even a reason to have a separate function here? There appears to be only a single caller.

{
var resolvedIncludePath = ResolveIncludePath(_includePath, parent?.FilePath);

// If we still couldn't find it then throw an exception;
if (resolvedIncludePath == null)
{
throw new FileNotFoundException(string.Format(CodeAnalysisResources.FailedToResolveRuleSetName, _includePath), _includePath);
return null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with the premise of the change. But given there is a single caller think it would be simpler to just inline this changed method. Makes it clearer this has no other impact on the code.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I've inlined the method.

}

// Return the canonical full path
Expand Down