Merge pull request #4348 from mathias-lang-sociomantic/commaexp

Do not rely on the result of a comma expression
This commit is contained in:
Dmitry Olshansky 2016-05-27 18:40:27 +04:00
commit a207b27056

View file

@ -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)
res = std.utf.decode(_origin, _index);
return n;
}
@property bool atEnd(){
return _index == _origin.length;