Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Side by Side Diff: third_party/pkg/angular/lib/change_detection/linked_list.dart

Issue 256553002: Revert "Update all Angular libs (run update_all.sh)." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 part of angular.watch_group; 1 part of angular.watch_group;
2 2
3 3
4 class _LinkedListItem<I extends _LinkedListItem> { 4 class _LinkedListItem<I extends _LinkedListItem> {
5 I _previous, _next; 5 I _previous, _next;
6 } 6 }
7 7
8 class _LinkedList<L extends _LinkedListItem> { 8 class _LinkedList<L extends _LinkedList> {
9 L _head, _tail; 9 L _head, _tail;
10 10
11 static _Handler _add(_Handler list, _LinkedListItem item) { 11 static _Handler _add(_Handler list, _LinkedListItem item) {
12 assert(item._next == null); 12 assert(item._next == null);
13 assert(item._previous == null); 13 assert(item._previous == null);
14 if (list._tail == null) { 14 if (list._tail == null) {
15 list._head = list._tail = item; 15 list._head = list._tail = item;
16 } else { 16 } else {
17 item._previous = list._tail; 17 item._previous = list._tail;
18 list._tail._next = item; 18 list._tail._next = item;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 if (next == null) list._watchTail = previous; else next._previousWatch = previous; 85 if (next == null) list._watchTail = previous; else next._previousWatch = previous;
86 } 86 }
87 } 87 }
88 88
89 abstract class _EvalWatchList { 89 abstract class _EvalWatchList {
90 _EvalWatchRecord _evalWatchHead, _evalWatchTail; 90 _EvalWatchRecord _evalWatchHead, _evalWatchTail;
91 _EvalWatchRecord get _marker; 91 _EvalWatchRecord get _marker;
92 92
93 static _EvalWatchRecord _add(_EvalWatchList list, _EvalWatchRecord item) { 93 static _EvalWatchRecord _add(_EvalWatchList list, _EvalWatchRecord item) {
94 assert(item._nextEvalWatch == null); 94 assert(item._nextEvalWatch == null);
95 assert(item._prevEvalWatch == null); 95 assert(item._previousEvalWatch == null);
96 var prev = list._evalWatchTail; 96 var prev = list._evalWatchTail;
97 var next = prev._nextEvalWatch; 97 var next = prev._nextEvalWatch;
98 98
99 if (prev == list._marker) { 99 if (prev == list._marker) {
100 list._evalWatchHead = list._evalWatchTail = item; 100 list._evalWatchHead = list._evalWatchTail = item;
101 prev = prev._prevEvalWatch; 101 prev = prev._previousEvalWatch;
102 list._marker._prevEvalWatch = null;
103 list._marker._nextEvalWatch = null;
104 } 102 }
105 item._nextEvalWatch = next; 103 item._nextEvalWatch = next;
106 item._prevEvalWatch = prev; 104 item._previousEvalWatch = prev;
107 105
108 if (prev != null) prev._nextEvalWatch = item; 106 if (prev != null) prev._nextEvalWatch = item;
109 if (next != null) next._prevEvalWatch = item; 107 if (next != null) next._previousEvalWatch = item;
110 108
111 return list._evalWatchTail = item; 109 return list._evalWatchTail = item;
112 } 110 }
113 111
114 static bool _isEmpty(_EvalWatchList list) => list._evalWatchHead == null; 112 static bool _isEmpty(_EvalWatchList list) => list._evalWatchHead == null;
115 113
116 static void _remove(_EvalWatchList list, _EvalWatchRecord item) { 114 static void _remove(_EvalWatchList list, _EvalWatchRecord item) {
117 assert(item.watchGrp == list); 115 assert(item.watchGrp == list);
118 var prev = item._prevEvalWatch; 116 var prev = item._previousEvalWatch;
119 var next = item._nextEvalWatch; 117 var next = item._nextEvalWatch;
120 118
121 if (list._evalWatchHead == list._evalWatchTail) { 119 if (list._evalWatchHead == list._evalWatchTail) {
122 list._evalWatchHead = list._evalWatchTail = list._marker; 120 list._evalWatchHead = list._evalWatchTail = list._marker;
123 list._marker 121 list._marker
124 .._nextEvalWatch = next 122 .._nextEvalWatch = next
125 .._prevEvalWatch = prev; 123 .._previousEvalWatch = prev;
126 if (prev != null) prev._nextEvalWatch = list._marker; 124 if (prev != null) prev._nextEvalWatch = list._marker;
127 if (next != null) next._prevEvalWatch = list._marker; 125 if (next != null) next._previousEvalWatch = list._marker;
128 } else { 126 } else {
129 if (item == list._evalWatchHead) list._evalWatchHead = next; 127 if (item == list._evalWatchHead) list._evalWatchHead = next;
130 if (item == list._evalWatchTail) list._evalWatchTail = prev; 128 if (item == list._evalWatchTail) list._evalWatchTail = prev;
131 if (prev != null) prev._nextEvalWatch = next; 129 if (prev != null) prev._nextEvalWatch = next;
132 if (next != null) next._prevEvalWatch = prev; 130 if (next != null) next._previousEvalWatch = prev;
133 } 131 }
134 } 132 }
135 } 133 }
136 134
137 class _WatchGroupList { 135 class _WatchGroupList {
138 WatchGroup _watchGroupHead, _watchGroupTail; 136 WatchGroup _watchGroupHead, _watchGroupTail;
139 137
140 static WatchGroup _add(_WatchGroupList list, WatchGroup item) { 138 static WatchGroup _add(_WatchGroupList list, WatchGroup item) {
141 assert(item._nextWatchGroup == null); 139 assert(item._nextWatchGroup == null);
142 assert(item._prevWatchGroup == null); 140 assert(item._previousWatchGroup == null);
143 if (list._watchGroupTail == null) { 141 if (list._watchGroupTail == null) {
144 list._watchGroupHead = list._watchGroupTail = item; 142 list._watchGroupHead = list._watchGroupTail = item;
145 } else { 143 } else {
146 item._prevWatchGroup = list._watchGroupTail; 144 item._previousWatchGroup = list._watchGroupTail;
147 list._watchGroupTail._nextWatchGroup = item; 145 list._watchGroupTail._nextWatchGroup = item;
148 list._watchGroupTail = item; 146 list._watchGroupTail = item;
149 } 147 }
150 return item; 148 return item;
151 } 149 }
152 150
153 static bool _isEmpty(_WatchGroupList list) => list._watchGroupHead == null; 151 static bool _isEmpty(_WatchGroupList list) => list._watchGroupHead == null;
154 152
155 static void _remove(_WatchGroupList list, WatchGroup item) { 153 static void _remove(_WatchGroupList list, WatchGroup item) {
156 var previous = item._prevWatchGroup; 154 var previous = item._previousWatchGroup;
157 var next = item._nextWatchGroup; 155 var next = item._nextWatchGroup;
158 156
159 if (previous == null) list._watchGroupHead = next; else previous._nextWa tchGroup = next; 157 if (previous == null) list._watchGroupHead = next; else previous._nextWa tchGroup = next;
160 if (next == null) list._watchGroupTail = previous; else next._prevWatchG roup = previous; 158 if (next == null) list._watchGroupTail = previous; else next._previousWa tchGroup = previous;
161 } 159 }
162 } 160 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698