# Revert "std.SinglyLinkedList: add sort function" · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/e834e95d718fe3eacaec54034462c90fd10bfe76)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: e834e95d718fe3eacaec54034462c90fd10bfe76

Requested commit: e834e95d718fe3eacaec54034462c90fd10bfe76

Commit: e834e95d718fe3eacaec54034462c90fd10bfe76

Tree: 8592deca9862274ce41d9b6b2ca356ad25b757b5

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
Revert "std.SinglyLinkedList: add sort function"

This reverts commit 8b10970836480a43a3bbb1276cb258c2a8b613f2.

This implementation has the following problems:

* It does not provide context to the less than function. This will be an
  API break in order to fix.
* It uses recursion, causing unbounded stack memory usage - likely
  depending on user input, which is extra problematic.
* Sorting linked lists is generally an inefficient operation;
  encouraging it by having a standard library function for it may
  lead to suboptimal software being written in Zig.

Furthermore, there is almost no benefit to providing a sort function as
a method, when a third party implementation can easily be passed a
linked list to then be sorted.

```

## Parents

- [8b10970836480a43a3bbb1276cb258c2a8b613f2](https://git.cafe/gitcafe/zig/commit/8b10970836480a43a3bbb1276cb258c2a8b613f2?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/e834e95d718fe3eacaec54034462c90fd10bfe76?format=markdown)
