mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 21:21:19 +01:00
fixed a linting error in action.cpp (#2844)
There was a warning "Unchecked access to optional value" in this piece of code inside `action.cpp`
```cpp
if (this->scope().has_value()) {
out << " " << *this->scope();a
}
```
Fixed it by accessing `scope_` directly rather than using `this->scope()`.
This commit is contained in:
@@ -152,8 +152,8 @@ void Action::Print(llvm::raw_ostream& out) const {
|
||||
}
|
||||
out << "]]";
|
||||
}
|
||||
if (this->scope().has_value()) {
|
||||
out << " " << *this->scope();
|
||||
if (scope_.has_value()) {
|
||||
out << " " << *scope_;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user