1
0
mirror of https://github.com/oliverbooth/X10D synced 2024-11-23 00:38:47 +00:00

style: remove redundant else branches

This commit is contained in:
Oliver Booth 2023-04-01 22:01:07 +01:00
parent d7bf9d1788
commit b79435211a
No known key found for this signature in database
GPG Key ID: 20BEB9DC87961025

View File

@ -1,4 +1,4 @@
using System.Diagnostics.Contracts;
using System.Diagnostics.Contracts;
using System.Runtime.InteropServices;
using System.Web;
@ -70,11 +70,9 @@ public static class DictionaryExtensions
return updated;
}
else
{
dictionary.Add(key, addValue);
return addValue;
}
#endif
}
@ -126,12 +124,10 @@ public static class DictionaryExtensions
return updated;
}
else
{
dictionary.Add(key, addValue);
return addValue;
}
}
/// <summary>
/// Uses the specified functions to add a key/value pair to the <see cref="Dictionary{TKey,TValue}" /> if the key does
@ -202,13 +198,11 @@ public static class DictionaryExtensions
return updated;
}
else
{
var add = addValueFactory(key);
dictionary.Add(key, add);
return add;
}
#endif
}
@ -268,14 +262,12 @@ public static class DictionaryExtensions
return updated;
}
else
{
var add = addValueFactory(key);
dictionary.Add(key, add);
return add;
}
}
/// <summary>
/// Uses the specified functions and argument to add a key/value pair to the <see cref="Dictionary{TKey,TValue}" /> if
@ -352,13 +344,11 @@ public static class DictionaryExtensions
return updated;
}
else
{
var add = addValueFactory(key, factoryArgument);
dictionary.Add(key, add);
return add;
}
#endif
}
@ -424,14 +414,12 @@ public static class DictionaryExtensions
return updated;
}
else
{
var add = addValueFactory(key, factoryArgument);
dictionary.Add(key, add);
return add;
}
}
/// <summary>
/// Converts an <see cref="IEnumerable{T}" /> of <see cref="KeyValuePair{TKey, TValue}" /> to a data connection