Avoid unnecessary copy of a Status.
PiperOrigin-RevId: 262505241
This commit is contained in:
parent
265f118243
commit
0d1a1413c8
@ -299,7 +299,7 @@ const std::vector<Operation>& Scope::control_deps() const {
|
||||
return impl()->control_deps_;
|
||||
}
|
||||
|
||||
void Scope::UpdateStatus(const Status s) const {
|
||||
void Scope::UpdateStatus(const Status& s) const {
|
||||
impl()->status_->Update(s);
|
||||
if (impl()->exit_on_error_ && !ok()) {
|
||||
LOG(FATAL) << *impl()->status_;
|
||||
|
@ -177,7 +177,7 @@ class Scope {
|
||||
/// Note: The status object is shared between all children of this scope.
|
||||
/// If the resulting status is not Status::OK() and exit_on_error_ is set on
|
||||
/// this scope, this function exits by calling LOG(FATAL).
|
||||
void UpdateStatus(const Status s) const;
|
||||
void UpdateStatus(const Status& s) const;
|
||||
|
||||
// START_SKIP_DOXYGEN
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user