Subversion Repositories Kolibri OS

Rev

Rev 7983 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7983 Rev 8097
Line 1... Line 1...
1
(*
1
(*
2
    BSD 2-Clause License
2
    BSD 2-Clause License
Line 3... Line 3...
3
 
3
 
4
    Copyright (c) 2018-2019, Anton Krotov
4
    Copyright (c) 2018-2020, Anton Krotov
5
    All rights reserved.
5
    All rights reserved.
Line 6... Line 6...
6
*)
6
*)
Line 30... Line 30...
30
    ASSERT(list # NIL);
30
    ASSERT(list # NIL);
31
    ASSERT(item # NIL);
31
    ASSERT(item # NIL);
Line 32... Line 32...
32
 
32
 
33
    IF list.first = NIL THEN
33
    IF list.first = NIL THEN
34
        list.first := item;
-
 
35
        list.last  := item;
34
        list.first := item;
36
        item.prev  := NIL;
-
 
37
        item.next  := NIL
35
        item.prev  := NIL
38
    ELSE
36
    ELSE
39
        ASSERT(list.last # NIL);
-
 
40
 
37
        ASSERT(list.last # NIL);
41
        item.prev := list.last;
38
        item.prev := list.last;
42
        list.last.next := item;
39
        list.last.next := item
43
        item.next := NIL;
40
    END;
44
        list.last := item
41
    list.last := item;
45
    END
42
    item.next := NIL
Line 46... Line 43...
46
END push;
43
END push;
47
 
44
 
Line 106... Line 103...
106
 
103
 
Line 107... Line 104...
107
    prev := cur.prev;
104
    prev := cur.prev;
108
 
105
 
109
    IF prev # NIL THEN
106
    IF prev # NIL THEN
110
        prev.next := nov;
-
 
111
        nov.prev := prev;
-
 
112
        cur.prev := nov;
107
        prev.next := nov;
113
        nov.next := cur
108
        nov.prev := prev
114
    ELSE
-
 
115
        nov.prev := NIL;
-
 
116
        cur.prev := nov;
109
    ELSE
117
        nov.next := cur;
110
        nov.prev := NIL;
118
        list.first := nov
-
 
-
 
111
        list.first := nov
-
 
112
    END;
119
    END
113
    cur.prev := nov;
Line 120... Line 114...
120
 
114
    nov.next := cur
121
END insertL;
115
END insertL;