[phobos] [D-Programming-Language/phobos] 0c5270: Refactored endsWith to use retro + startsWith.

GitHub noreply at github.com
Sun Dec 23 19:52:02 PST 2012


  Branch: refs/heads/master
  Home:   https://github.com/D-Programming-Language/phobos
  Commit: 0c52706eb6834059875fc9ba0db5098d7f340533
      https://github.com/D-Programming-Language/phobos/commit/0c52706eb6834059875fc9ba0db5098d7f340533
  Author: Peter Alexander <peter.alexander.au at gmail.com>
  Date:   2012-12-16 (Sun, 16 Dec 2012)

  Changed paths:
    M std/algorithm.d

  Log Message:
  -----------
  Refactored endsWith to use retro + startsWith.

What's the point of having all these powerful, generic, abstract functions if we're just going to copy and paste code? :-)

This change has several benefits:

* It is far more elegant.
* Changes (optimisations) to startsWith automatically carry across to endsWith.
* We get extra testing for startsWith and retro for free.


  Commit: c1f8609e1fa6e6e5a61b262a223f37f13fae22b9
      https://github.com/D-Programming-Language/phobos/commit/c1f8609e1fa6e6e5a61b262a223f37f13fae22b9
  Author: Andrei Alexandrescu <andrei at erdani.com>
  Date:   2012-12-23 (Sun, 23 Dec 2012)

  Changed paths:
    M std/algorithm.d

  Log Message:
  -----------
  Merge pull request #1013 from Poita/endsWithRefactor

Refactored endsWith to use retro + startsWith.


Compare: https://github.com/D-Programming-Language/phobos/compare/99bece7a49a4...c1f8609e1fa6


More information about the phobos mailing list