From dc6e404545a98b887931ee8a95f8921c83b7bfeb Mon Sep 17 00:00:00 2001 From: Jeremy Friesen Date: Thu, 21 Feb 2019 19:08:57 -0800 Subject: [PATCH] Unneeded drop index helper --- LiteDB/Engine/Services/IndexService.cs | 35 -------------------------- 1 file changed, 35 deletions(-) diff --git a/LiteDB/Engine/Services/IndexService.cs b/LiteDB/Engine/Services/IndexService.cs index 8fe053fa9..233510c20 100644 --- a/LiteDB/Engine/Services/IndexService.cs +++ b/LiteDB/Engine/Services/IndexService.cs @@ -278,41 +278,6 @@ public void Delete(CollectionIndex index, PageAddress nodeAddress) } } - /// - /// Drop all indexes pages. Each index use a single page sequence - /// - public void DropIndex(CollectionIndex index) - { - var pages = new HashSet(); - var nodes = this.FindAll(index, Query.Ascending); - - // get reference for pageID from all index nodes - foreach (var node in nodes) - { - pages.Add(node.Position.PageID); - - // for each node I need remove from node list datablock reference - var prevNode = this.GetNode(node.PrevNode); - var nextNode = this.GetNode(node.NextNode); - - if (prevNode != null) - { - prevNode.NextNode = node.NextNode; - _pager.SetDirty(prevNode.Page); - } - if (nextNode != null) - { - nextNode.PrevNode = node.PrevNode; - _pager.SetDirty(nextNode.Page); - } - } - - // now delete all pages - foreach (var pageID in pages) - { - _pager.DeletePage(pageID); - } - } /// /// Get a node inside a page using PageAddress - Returns null if address IsEmpty