Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions std/regex/internal/ir.d
Original file line number Diff line number Diff line change
Expand Up @@ -606,15 +606,15 @@ struct Input(Char)
}

//codepoint at current stream position
bool nextChar(ref dchar res, ref size_t pos)
pragma(inline, true) bool nextChar(ref dchar res, ref size_t pos)
{
pos = _index;
// DMD's inliner hates multiple return functions
// but can live with single statement if/else bodies
if (_index == _origin.length)
return false;
else
return res = std.utf.decode(_origin, _index), true;
bool n = !(_index == _origin.length);
if (n)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The re-write is fine, just please make sure it's inlined by DMD.

res = std.utf.decode(_origin, _index);
return n;
}
@property bool atEnd(){
return _index == _origin.length;
Expand Down