Bug 4538 – Listed complexity of reverse() is incorrect

Status
RESOLVED
Resolution
FIXED
Severity
trivial
Priority
P2
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2010-07-30T19:10:00Z
Last change time
2012-02-05T16:30:26Z
Keywords
pull
Assigned to
andrei
Creator
Justin.SpahrSummers

Comments

Comment #0 by Justin.SpahrSummers — 2010-07-30T19:10:10Z
Really minor issue, but I noticed that the complexity of reverse() -- in terms of calls to swap() -- is incorrect in the Phobos2 documentation. It states: Reverses r in-place. Performs r.length evaluations of swap. when reversal should actually only perform, and assumably does perform, r.length / 2 evaluations of swap().
Comment #1 by andrei — 2010-07-30T19:30:21Z
Thanks!
Comment #2 by yao.gomez — 2012-02-05T15:11:33Z
pull https://github.com/D-Programming-Language/phobos/pull/421 This changes std.algorithm.reverse documentation to: Reverses r in-place. Performs r.length evaluations of swap.
Comment #3 by github-bugzilla — 2012-02-05T16:22:10Z
Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/7c6caad85c6aa3cf7029a15b785797d086df4ae5 Merge pull request #421 from YaoGomez/fix-algorithm-swap-docs [doc] Fix std.algorithm.reverse docs (Issue 4538)