File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -101,9 +101,7 @@ class ListWrapper {
101101 list.remove (items[i]);
102102 }
103103 }
104- static remove (List list, item) {
105- list.remove (item);
106- }
104+ static bool remove (List list, item) => list.remove (item);
107105 static void clear (List l) { l.clear (); }
108106 static String join (List l, String s) => l.join (s);
109107 static bool isEmpty (list) => list.isEmpty;
Original file line number Diff line number Diff line change @@ -149,9 +149,13 @@ export class ListWrapper {
149149 list . splice ( index , 1 ) ;
150150 }
151151 }
152- static remove ( list , item ) {
153- var index = list . indexOf ( item ) ;
154- list . splice ( index , 1 ) ;
152+ static remove ( list , el ) : boolean {
153+ var index = list . indexOf ( el ) ;
154+ if ( index > - 1 ) {
155+ list . splice ( index , 1 ) ;
156+ return true ;
157+ }
158+ return false ;
155159 }
156160 static clear ( list ) {
157161 list . splice ( 0 , list . length ) ;
You can’t perform that action at this time.
0 commit comments