[phobos] [D-Programming-Language/phobos] dff1cc: std.datetime: Remove redundant SYSTEMTIME step whe...

GitHub noreply at github.com
Fri Apr 20 20:53:39 PDT 2012


  Branch: refs/heads/master
  Home:   https://github.com/D-Programming-Language/phobos
  Commit: dff1cc17d135cf1ac4175b14b3ab5350d8f1eb6b
      https://github.com/D-Programming-Language/phobos/commit/dff1cc17d135cf1ac4175b14b3ab5350d8f1eb6b
  Author: Vladimir Panteleev <vladimir at thecybershadow.net>
  Date:   2012-04-04 (Wed, 04 Apr 2012)

  Changed paths:
    M std/datetime.d

  Log Message:
  -----------
  std.datetime: Remove redundant SYSTEMTIME step when converting FILETIME

Both FILETIME and SysTime store time as the number of elapsed hnsecs
since a certain (different) epoch. Therefore, the optimal way to convert
between the two would be simply adding/subtracting the epoch difference.
This is not what std.datetime used to do - instead, FILETIME values
were converted to SYSTEMTIME (a structure with year/month/day/etc.
fields), and then created the SysTime result from that (and vice-versa),
which was very inefficient.

The "add epoch difference" method was already used in SysTime.currStdTime.
It has been refactored out and used in FILETIME conversion functions.


  Commit: 49f3ca2e55f7121d0fdddae595fd2163a0719383
      https://github.com/D-Programming-Language/phobos/commit/49f3ca2e55f7121d0fdddae595fd2163a0719383
  Author: Jonathan M Davis <jmdavisProg at gmx.com>
  Date:   2012-04-20 (Fri, 20 Apr 2012)

  Changed paths:
    M std/datetime.d

  Log Message:
  -----------
  Merge pull request #518 from CyberShadow/std-datetime-optimize-filetime

std.datetime: Remove redundant SYSTEMTIME step when converting FILETIME


Compare: https://github.com/D-Programming-Language/phobos/compare/b647510...49f3ca2


More information about the phobos mailing list