File tree 2 files changed +27
-2
lines changed
2 files changed +27
-2
lines changed Original file line number Diff line number Diff line change 236
236
<Compile Include =" ..\Nancy\DefaultRootPathProvider.cs" >
237
237
<Link >DefaultRootPathProvider.cs</Link >
238
238
</Compile >
239
+ <Compile Include =" ..\Nancy\ArrayCache.cs" >
240
+ <Link >ArrayCache.cs</Link >
241
+ </Compile >
239
242
<Compile Include =" ..\Nancy\DefaultRouteConfigurationProvider.cs" >
240
243
<Link >DefaultRouteConfigurationProvider.cs</Link >
241
244
</Compile >
1520
1523
</EmbeddedResource >
1521
1524
</ItemGroup >
1522
1525
<Import Project =" $(MSBuildToolsPath)\Microsoft.CSharp.targets" />
1523
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
1526
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
1524
1527
Other similar extension points exist, see Microsoft.Common.targets.
1525
1528
<Target Name="BeforeBuild">
1526
1529
</Target>
1527
1530
<Target Name="AfterBuild">
1528
1531
</Target>
1529
1532
-->
1530
- </Project >
1533
+ </Project >
Original file line number Diff line number Diff line change
1
+ namespace Nancy
2
+ {
3
+ /// <summary>
4
+ /// A cache for empty arrays.
5
+ /// </summary>
6
+ public class ArrayCache
7
+ {
8
+ /// <summary>
9
+ /// Gets a cached, empty array of the specified type.
10
+ /// </summary>
11
+ /// <typeparam name="T">the type of array to get.</typeparam>
12
+ public static T [ ] Empty < T > ( )
13
+ {
14
+ return EmptyArray < T > . Value ;
15
+ }
16
+
17
+ private static class EmptyArray < T >
18
+ {
19
+ public static readonly T [ ] Value = new T [ 0 ] ;
20
+ }
21
+ }
22
+ }
You can’t perform that action at this time.
0 commit comments