Skip to content

Conversation

@pav-kv
Copy link
Contributor

@pav-kv pav-kv commented Feb 27, 2024

The insertion sort is no longer needed, since Go 1.21 introduced a generic slices.Sort algorithm which achieves the same effect: it doesn't incur allocations, and uses insertion sort for slices up to 12 elements.

@pav-kv pav-kv requested a review from ahrtr February 27, 2024 21:55
The insertion sort is no longer needed, since Go 1.21 introduced a
generic slices.Sort algorithm which achieves the same effect: it doesn't
incur allocations, and uses insertion sort for slices up to 12 elements.

Signed-off-by: Pavel Kalinnikov <[email protected]>
@ahrtr
Copy link
Member

ahrtr commented Feb 28, 2024

Note: This PR will require the applications, which depend on raft, to use a go version >= 1.21. It shouldn't be a problem, because go1.20 is already out of support. But we should document the requirement in readme.

@pav-kv
Copy link
Contributor Author

pav-kv commented Feb 28, 2024

go.mod already states 1.21, plus some other 1.21+ things are already used (e.g. #135). Seems like this PR isn't the best place to update documentation.

@ahrtr
Copy link
Member

ahrtr commented Feb 28, 2024

go.mod already states 1.21

It doesn't technically prevent applications, which depend on raft, from using a old go version.

some other 1.21+ things are already used (e.g. #135). Seems like this PR isn't the best place to update documentation.

OK. We can take care of the document separately.

@ahrtr ahrtr merged commit 067d3e9 into etcd-io:main Feb 28, 2024
@pav-kv pav-kv deleted the use-native-sort branch February 28, 2024 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants