Skip to content

Commit

Permalink
chore: Fix additional CA1510 rules
Browse files Browse the repository at this point in the history
  • Loading branch information
filzrev committed Jul 29, 2023
1 parent b9b0997 commit 5289ac0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 16 deletions.
6 changes: 2 additions & 4 deletions src/Docfx.App/Helpers/MetadataMerger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ internal class MetadataMerger

public void Merge(MetadataMergeParameters parameters)
{
if (parameters == null)
{
throw new ArgumentNullException(nameof(parameters));
}
ArgumentNullException.ThrowIfNull(parameters);

if (parameters.OutputBaseDir == null)
{
throw new ArgumentException("Output folder cannot be null.", nameof(parameters) + "." + nameof(parameters.OutputBaseDir));
Expand Down
5 changes: 1 addition & 4 deletions src/Docfx.Build.Common/Reference/OverwriteDocumentReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ public static FileModel Read(FileAndType file)
/// <returns></returns>
public static IEnumerable<T> Transform<T>(FileModel model, string uid, Func<T, T> itemBuilder) where T : class, IOverwriteDocumentViewModel
{
if (model == null)
{
throw new ArgumentNullException(nameof(model));
}
ArgumentNullException.ThrowIfNull(model);

var overwrites = ((List<OverwriteDocumentModel>)model.Content).Where(s => s.Uid == uid);
return overwrites.Select(s =>
Expand Down
6 changes: 2 additions & 4 deletions src/Docfx.Common/CompositeDictionary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,8 @@ void ICollection<KeyValuePair<string, object>>.Add(KeyValuePair<string, object>

public void Add(string key, object value)
{
if (key == null)
{
throw new ArgumentNullException(nameof(key));
}
ArgumentNullException.ThrowIfNull(key);

foreach (var entry in _entries)
{
if (key.StartsWith(entry.Prefix))
Expand Down
6 changes: 2 additions & 4 deletions src/Docfx.Plugins/XRefSpec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ public XRefSpec(IDictionary<string, object> dictionary)

public XRefSpec(XRefSpec spec)
{
if (spec == null)
{
throw new ArgumentNullException(nameof(spec));
}
ArgumentNullException.ThrowIfNull(spec);

_dict = new Dictionary<string, object>(spec._dict);
}

Expand Down

0 comments on commit 5289ac0

Please sign in to comment.