lazy paths for Babel support
This commit is contained in:
parent
a840a4ce53
commit
c98696d742
8 changed files with 57 additions and 23 deletions
|
|
@ -90,6 +90,15 @@ proc Remove*(list: var TLinkedList, entry: PListEntry) =
|
|||
if entry.next != nil: entry.next.prev = entry.prev
|
||||
if entry.prev != nil: entry.prev.next = entry.next
|
||||
|
||||
proc bringToFront*(list: var TLinkedList, entry: PListEntry) =
|
||||
if entry == list.head: return
|
||||
if entry == list.tail: list.tail = entry.prev
|
||||
if entry.next != nil: entry.next.prev = entry.prev
|
||||
if entry.prev != nil: entry.prev.next = entry.next
|
||||
entry.prev = nil
|
||||
entry.next = list.head
|
||||
list.head = entry
|
||||
|
||||
proc ExcludeStr*(list: var TLinkedList, data: string) =
|
||||
var it = list.head
|
||||
while it != nil:
|
||||
|
|
@ -99,6 +108,6 @@ proc ExcludeStr*(list: var TLinkedList, data: string) =
|
|||
|
||||
proc Find*(list: TLinkedList, fn: TCompareProc, closure: Pointer): PListEntry =
|
||||
result = list.head
|
||||
while result != nil:
|
||||
while result != nil:
|
||||
if fn(result, closure): return
|
||||
result = result.next
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue