mirror of
https://github.com/dlang/phobos.git
synced 2025-04-29 22:50:38 +03:00
Merge pull request #4348 from mathias-lang-sociomantic/commaexp
Do not rely on the result of a comma expression
This commit is contained in:
commit
a207b27056
1 changed files with 5 additions and 5 deletions
|
@ -606,15 +606,15 @@ struct Input(Char)
|
||||||
}
|
}
|
||||||
|
|
||||||
//codepoint at current stream position
|
//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;
|
pos = _index;
|
||||||
// DMD's inliner hates multiple return functions
|
// DMD's inliner hates multiple return functions
|
||||||
// but can live with single statement if/else bodies
|
// but can live with single statement if/else bodies
|
||||||
if (_index == _origin.length)
|
bool n = !(_index == _origin.length);
|
||||||
return false;
|
if (n)
|
||||||
else
|
res = std.utf.decode(_origin, _index);
|
||||||
return res = std.utf.decode(_origin, _index), true;
|
return n;
|
||||||
}
|
}
|
||||||
@property bool atEnd(){
|
@property bool atEnd(){
|
||||||
return _index == _origin.length;
|
return _index == _origin.length;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue