Lucene.Net.Index.TestTermsEnum.Accepts C# (CSharp) Method

Accepts() private method

private Accepts ( CompiledAutomaton c, BytesRef b ) : bool
c CompiledAutomaton
b BytesRef
return bool
        private bool Accepts(CompiledAutomaton c, BytesRef b)
        {
            int state = c.RunAutomaton.InitialState;
            for (int idx = 0; idx < b.Length; idx++)
            {
                Assert.IsTrue(state != -1);
                state = c.RunAutomaton.Step(state, b.Bytes[b.Offset + idx] & 0xff);
            }
            return c.RunAutomaton.IsAccept(state);
        }