File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -217,7 +217,7 @@ func (ll *LockingList) Pop() any {
217217 return nil
218218 }
219219 _ = ll .Lock ()
220- e := ll .l .Back ()
220+ e := ll .l .Front ()
221221 ll .l .Remove (e )
222222 ll .Unlock ()
223223 return e .Value
Original file line number Diff line number Diff line change @@ -430,9 +430,9 @@ func TestThePlanet(t *testing.T) {
430430 t .Errorf ("Push(%d) = %v, want nil" , i , err )
431431 }
432432 }
433- for i := 4 ; i > 0 ; i -- {
434- if pl .Pop () != i {
435- t .Errorf ("Pop() = %d, want %d" , pl . Pop () , i )
433+ for i := 1 ; i < 5 ; i ++ {
434+ if got := pl .Pop (); got != i {
435+ t .Errorf ("Pop() = %d, want %d" , got , i )
436436 }
437437 }
438438 for i := 1 ; i < 5 ; i ++ {
@@ -450,7 +450,7 @@ func TestThePlanet(t *testing.T) {
450450 wg .Add (1 )
451451 go func (n int ) {
452452 if cerr := cl .Push (n ); cerr != nil {
453- t .Errorf ("Push(%d) err = %v, want nil" , i , cerr )
453+ t .Errorf ("Push(%d) err = %v, want nil" , n , cerr )
454454 }
455455 wg .Done ()
456456 }(i )
You can’t perform that action at this time.
0 commit comments