Hi Yijian, Why don't you try removing it, and see if the tests still pass. If all the tests still pass, then maybe you'd found an optimization here.
Scott On Sun, May 8, 2016 at 8:56 AM, shanghaihyj <[email protected]> wrote: > I'm studying the BytesRefHash class, a mapping from bytes to a generated > ID for the bytes. > > In the BytesRefHash class, there are two levels of reference: > (1) ids[bytes' hash code] ---> count, where count is the self-incremental > size of the this hashmap. > (2) bytesStart[count] ---> offset in the ByteBlockPool, where the original > bytes are stored. > > My question is, can the above two references be collapsed into one, as > follows ? > ids[bytes' hash code] ---> offset in the ByteBlockPool. > > I've searched the code, and cannot grab an idea what's the benefit to have > another indirection via bytesStart. > > p.s. I am a newbie. Should basic questions about Lucene source code be > asked in this mail list [email protected] or elsewhere ? > > Yijian Huang > > > >
