mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-21 08:48:57 +00:00
AK: Optional::operator bool() should consume the Optional
We use consumable annotations to catch bugs where you get the .value() of an Optional before verifying that it's okay. The bug here was that only has_value() would set the consumed state, even though operator bool() does the same job.
This commit is contained in:
parent
e75e33eb46
commit
a00419ed77
Notes:
sideshowbarker
2024-07-19 12:33:08 +09:00
Author: https://github.com/awesomekling
Commit: a00419ed77
1 changed files with 1 additions and 0 deletions
|
@ -121,6 +121,7 @@ public:
|
|||
return fallback;
|
||||
}
|
||||
|
||||
SET_TYPESTATE(consumed)
|
||||
operator bool() const { return m_has_value; }
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue