Skip to content
Snippets Groups Projects
Commit 4d819db7 authored by Jonathan Wakely's avatar Jonathan Wakely
Browse files

libstdc++: Use unsigned division in std::rotate [PR113811]

Signed 64-bit division is much slower than unsigned, so cast the n and
k values to unsigned before doing n %= k. We know this is safe because
neither value can be negative.

libstdc++-v3/ChangeLog:

	PR libstdc++/113811
	* include/bits/stl_algo.h (__rotate): Use unsigned values for
	division.
parent b58f0e52
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment