private int CompareData(ValueReader other, int len) { if (_buffer != null) { fixed(byte *a = _buffer) { if (other._buffer != null) { fixed(byte *b = other._buffer) { return(Memory.Compare(a, b, len)); } } return(Memory.Compare(a, other._val, len)); } } if (other._buffer != null) { fixed(byte *b = other._buffer) { return(Memory.Compare(_val, b, len)); } } return(Memory.Compare(_val, other._val, len)); }
private int CompareData(ValueReader other, int len) { if (_buffer != null) { fixed(byte *a = _buffer) { if (other._buffer != null) { fixed(byte *b = other._buffer) { return(NativeMethods.memcmp(a, b, len)); } } return(NativeMethods.memcmp(a, other._val, len)); } } if (other._buffer != null) { fixed(byte *b = other._buffer) { return(NativeMethods.memcmp(_val, b, len)); } } return(NativeMethods.memcmp(_val, other._val, len)); }
public int CompareTo(ValueReader other) { int r = CompareData(other, Math.Min(Length, other.Length)); if (r != 0) { return(r); } return(Length - other.Length); }
public int CompareTo(ValueReader other) { int size = Math.Min(Length, other.Length); int r = Memory.CompareInline(_val, other._val, size); if (r != 0) { return(r); } return(Length - other.Length); }
public ReadResult(ValueReader reader, ushort version) { Reader = reader; Version = version; }
private int CompareData(ValueReader other, int len) { if (_buffer != null) { fixed (byte* a = _buffer) { if (other._buffer != null) { fixed (byte* b = other._buffer) { return Memory.Compare(a, b, len); } } return Memory.Compare(a, other._val, len); } } if (other._buffer != null) { fixed (byte* b = other._buffer) { return Memory.Compare(_val, b, len); } } return Memory.Compare(_val, other._val, len); }
public int CompareTo(ValueReader other) { int r = CompareData(other, Math.Min(Length, other.Length)); if (r != 0) return r; return Length - other.Length; }
private int CompareData(ValueReader other, int len) { if (_buffer != null) { fixed (byte* a = _buffer) { if (other._buffer != null) { fixed (byte* b = other._buffer) { return NativeMethods.memcmp(a, b, len); } } return NativeMethods.memcmp(a, other._val, len); } } if (other._buffer != null) { fixed (byte* b = other._buffer) { return NativeMethods.memcmp(_val, b, len); } } return NativeMethods.memcmp(_val, other._val, len); }
private void DeleteTermsForIndexEntry(SnapshotReader snapshot, ValueReader reader, long id, int fieldId) { var termBuffer = _bufferPool.Take(reader.Length); _usedBuffers.Add(termBuffer); reader.Read(termBuffer, 0, reader.Length); var termSlice = new Slice(termBuffer, (ushort) reader.Length); var tree = GetTreeName(fieldId); using (var termIt = snapshot.MultiRead(tree, termSlice)) { var currentFieldDocument = _bufferPool.Take(FullTextIndex.FieldDocumentSize); try { if (termIt.Seek(new Slice(currentFieldDocument)) == false) return; do { termIt.CurrentKey.CopyTo(currentFieldDocument); if (EndianBitConverter.Big.ToInt64(currentFieldDocument, 0) != id) break; var valueBuffer = _bufferPool.Take(termIt.CurrentKey.Size); _usedBuffers.Add(valueBuffer); termIt.CurrentKey.CopyTo(valueBuffer); _writeBatch.MultiDelete(termSlice, new Slice(valueBuffer), tree); } while (termIt.MoveNext()); } finally { _bufferPool.Return(currentFieldDocument); } } }