[phobos] [D-Programming-Language/phobos] 6b92ab: fix Issue 6222 - A problem with iota() using size_...

GitHub noreply at github.com
Sun Apr 22 17:52:58 PDT 2012


  Branch: refs/heads/master
  Home:   https://github.com/D-Programming-Language/phobos
  Commit: 6b92abb0449e6af80f68beb9fa1311346397bfaf
      https://github.com/D-Programming-Language/phobos/commit/6b92abb0449e6af80f68beb9fa1311346397bfaf
  Author: Brad Anderson <eco at gnuk.net>
  Date:   2012-04-20 (Fri, 20 Apr 2012)

  Changed paths:
    M std/range.d

  Log Message:
  -----------
  fix Issue 6222 - A problem with iota() using size_t

If the common type of begin and end is unsigned and end is 0 the private
member pastEnd ends up being unsigned.max due to "pastEnd - 1" (used to make
end not inclusive) which results in iota behaving incorrectly. A simple change
to always make an empty range when begin==end prevents this.

Also fixed and clarified the documentation.


  Commit: b1252f35afc019c37f334d274c257a25a4e0035f
      https://github.com/D-Programming-Language/phobos/commit/b1252f35afc019c37f334d274c257a25a4e0035f
  Author: David Simcha <dsimcha at gmail.com>
  Date:   2012-04-22 (Sun, 22 Apr 2012)

  Changed paths:
    M std/range.d

  Log Message:
  -----------
  Merge pull request #547 from eco/iota-unsigned-odd

fix Issue 6222 - A problem with iota() using size_t


Compare: https://github.com/D-Programming-Language/phobos/compare/70ad8e4...b1252f3


More information about the phobos mailing list