summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--compiler/lists.nim18
1 files changed, 11 insertions, 7 deletions
diff --git a/compiler/lists.nim b/compiler/lists.nim
index 67b32f919..22b1a183a 100644
--- a/compiler/lists.nim
+++ b/compiler/lists.nim
@@ -91,13 +91,17 @@ proc Remove*(list: var TLinkedList, entry: PListEntry) =
   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
+  when true:
+    list.remove entry
+    list.prepend entry
+  else:
+    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
pages' href='/akspecs/ranger/commit/doc/ranger.gui.html?h=v1.2.0&id=f07bb12fc5c59430e995a64956b36331ce3629b9'>f07bb12f ^
62cd83ba ^

4c13e1f2 ^
62cd83ba ^

f07bb12f ^
62cd83ba ^

f07bb12f ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31