mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-21 06:35:11 +00:00
Some code style cleanup
This commit is contained in:
@@ -30,14 +30,12 @@ namespace Octokit.Internal
|
||||
[SuppressMessage("Microsoft.Design", "CA1007:UseGenericsWhereAppropriate", Justification = "Need to support .NET 2")]
|
||||
protected override bool TrySerializeUnknownTypes(object input, out object output)
|
||||
{
|
||||
if (input == null) throw new ArgumentNullException("input");
|
||||
output = null;
|
||||
Type type = input.GetType();
|
||||
if (type.FullName == null)
|
||||
return false;
|
||||
IDictionary<string, object> obj = new JsonObject();
|
||||
IDictionary<string, ReflectionUtils.GetDelegate> getters = GetCache[type];
|
||||
foreach (KeyValuePair<string, ReflectionUtils.GetDelegate> getter in getters)
|
||||
Ensure.ArgumentNotNull(input, "input");
|
||||
|
||||
var type = input.GetType();
|
||||
var jsonObject = new JsonObject();
|
||||
var getters = GetCache[type];
|
||||
foreach (var getter in getters)
|
||||
{
|
||||
if (getter.Value != null)
|
||||
{
|
||||
@@ -45,10 +43,10 @@ namespace Octokit.Internal
|
||||
if (value == null)
|
||||
continue;
|
||||
|
||||
obj.Add(MapClrMemberNameToJsonFieldName(getter.Key), value);
|
||||
jsonObject.Add(MapClrMemberNameToJsonFieldName(getter.Key), value);
|
||||
}
|
||||
}
|
||||
output = obj;
|
||||
output = jsonObject;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user