Skip to content

Commit e8fe4e7

Browse files
authored
Merge pull request #6167 from JackStouffer/systime-fromISOExtString
Optimized std.datetime.systime.SysTime.fromISOExtString merged-on-behalf-of: Sebastian Wilzbach <[email protected]>
2 parents 3b3c3cb + eda179f commit e8fe4e7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

std/datetime/systime.d

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8414,18 +8414,18 @@ public:
84148414
{
84158415
import std.algorithm.searching : countUntil, find;
84168416
import std.conv : to;
8417-
import std.string : strip;
8417+
import std.string : strip, indexOf;
84188418

8419-
auto dstr = to!dstring(strip(isoExtString));
8419+
auto str = strip(isoExtString);
84208420

8421-
auto tIndex = dstr.countUntil('T');
8421+
auto tIndex = str.indexOf('T');
84228422
enforce(tIndex != -1, new DateTimeException(format("Invalid ISO Extended String: %s", isoExtString)));
84238423

8424-
auto found = dstr[tIndex + 1 .. $].find('.', 'Z', '+', '-');
8425-
auto dateTimeStr = dstr[0 .. $ - found[0].length];
8424+
auto found = str[tIndex + 1 .. $].find('.', 'Z', '+', '-');
8425+
auto dateTimeStr = str[0 .. $ - found[0].length];
84268426

8427-
dstring fracSecStr;
8428-
dstring zoneStr;
8427+
typeof(str) fracSecStr;
8428+
typeof(str) zoneStr;
84298429

84308430
if (found[1] != 0)
84318431
{

0 commit comments

Comments
 (0)