/// <summary> /// Deletes the current key/value pair and returns true if there is /// another key after it /// </summary> public bool DeleteCurrentAndMoveNext() { var currentKey = CurrentKey; _tree.Delete(currentKey); return(Seek(currentKey)); }
/// <summary> /// Deletes the current key/value pair and returns true if there is /// another key after it /// </summary> public bool DeleteCurrentAndMoveNext() { _tree.Delete(CurrentKey); return(MovePrev() && MoveNext()); }
private void put_doc(Random r, Guid etag, Dictionary<Guid, string> inMemoryKeysByEtag, HashSet<string> inMemoryKeys, string docKey, Tree docsTree, Tree metadataTree, Tree indexTree) { var docMetadata = new byte[r.Next(100, 7000)]; Array.Copy(etag.ToByteArray(), docMetadata, 16); if (inMemoryKeys.Add(docKey) == false) { // update var existingEtag = inMemoryKeysByEtag.First(x => x.Value == docKey).Key; indexTree.Delete(existingEtag.ToString()); inMemoryKeysByEtag.Remove(existingEtag); } docsTree.Add(docKey, get_doc_data(r)); metadataTree.Add(docKey, docMetadata); indexTree.Add(etag.ToString(), docKey); inMemoryKeysByEtag[etag] = docKey; }