Skip to content

Commit 2ad0142

Browse files
author
“Serge
committed
Skip intermediate anonymous type allocation.
1 parent eb3e451 commit 2ad0142

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

Src/Support/Google.Apis.Core/Util/ReflectionCache.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,8 @@ internal static PropertyWithAttribute[] GetRequestParameterProperties(Type type)
5353
{
5454
// Get properties, filter by attribute, and cache only the filtered result
5555
return t.GetProperties(BindingFlags.Instance | BindingFlags.Public)
56-
.Select(prop =>
57-
{
58-
var attribute = prop.GetCustomAttribute<RequestParameterAttribute>(inherit: false);
59-
return new { Property = prop, Attribute = attribute };
60-
})
61-
.Where(x => x.Attribute != null)
62-
.Select(x => new PropertyWithAttribute(x.Property, x.Attribute))
56+
.Select(prop => new PropertyWithAttribute(prop, prop.GetCustomAttribute<RequestParameterAttribute>(inherit: false)))
57+
.Where(pwa => pwa.Attribute != null)
6358
.ToArray();
6459
});
6560
}

0 commit comments

Comments
 (0)