mirror of
https://github.com/dlang/phobos.git
synced 2025-04-30 23:20:29 +03:00
[std.regex] Fix unsafe casts to bool
These are disallowed in `@safe` code with https://github.com/dlang/dmd/pull/16558.
This commit is contained in:
parent
45f7b06842
commit
ccd3115b8b
1 changed files with 2 additions and 2 deletions
|
@ -318,7 +318,7 @@ struct Bytecode
|
||||||
@property bool backreference() const
|
@property bool backreference() const
|
||||||
{
|
{
|
||||||
assert(code == IR.GroupStart || code == IR.GroupEnd);
|
assert(code == IR.GroupStart || code == IR.GroupEnd);
|
||||||
return cast(bool)(raw & 1 << 23);
|
return (raw & 1 << 23) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//mark as local reference (for backrefs in lookarounds)
|
//mark as local reference (for backrefs in lookarounds)
|
||||||
|
@ -332,7 +332,7 @@ struct Bytecode
|
||||||
@property bool localRef() const
|
@property bool localRef() const
|
||||||
{
|
{
|
||||||
assert(code == IR.Backref);
|
assert(code == IR.Backref);
|
||||||
return cast(bool)(raw & 1 << 23);
|
return (raw & 1 << 23) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//human readable name of instruction
|
//human readable name of instruction
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue