marcglasberg / fast_immutable_collections

Dart Package: Immutable lists, sets, maps, and multimaps, which are as fast as their native mutable counterparts. Extension methods and comparators for native Dart collections.
BSD 2-Clause "Simplified" License
217 stars 30 forks source link

Shouldn't IList.removeLast() returns the removed item? #33

Closed evandrmb closed 2 years ago

evandrmb commented 2 years ago

Hi, first I want to thank you for the amazing work it was done in this package. I've been using it since 2.0.2 and really helped with my projects. I'm currently in 7.0.3 and in the docs, it says removeLast "Pops and returns the last object in this list...", but instead it returns the new IList.

marcglasberg commented 2 years ago

Thanks, glad you like it!

Also, thanks for finding this dcumentation error. I have fixed it:

  /// Removes the last object from this list.
  /// This method reduces the length of `this` by one.
  /// The list must not be empty.
  /// If you want to recover the removed item, you can pass a mutable [removedItem].
  IList<T> removeLast([Output<T>? removedItem]) => removeAt(length - 1, removedItem);

See version [7.1.0].