Remove debug spew
[beagle.git] / beagled / Lucene.Net / upstream-changes / 25_avoid_boxing.patch
blobafc8c4c976cf2be671356ee56653603dda59ff49
1 From: Joe Shaw <joeshaw@novell.com>
3 Array.SetValue() boxes value types because the parameter is of type
4 object. Using an indexer on a typed array, however, doesn't. This
5 reduces a large number of unnecessary allocations.
7 Index: Index/SegmentReader.cs
8 ===================================================================
9 RCS file: /cvs/gnome/beagle/beagled/Lucene.Net/Index/SegmentReader.cs,v
10 retrieving revision 1.7
11 diff -u -p -u -r1.7 SegmentReader.cs
12 --- Index/SegmentReader.cs 2 Oct 2006 17:09:00 -0000 1.7
13 +++ Index/SegmentReader.cs 29 Nov 2006 19:22:29 -0000
14 @@ -520,7 +520,7 @@ namespace Lucene.Net.Index
15 byte[] ones = new byte[size];
16 byte val = DefaultSimilarity.EncodeNorm(1.0f);
17 for (int index = 0; index < size; index++)
18 - ones.SetValue(val, index);
19 + ones [index] = val;
21 return ones;