Avoid unnecessary copy of a Status.

PiperOrigin-RevId: 262505241
This commit is contained in:
Brian Zhao 2019-08-08 23:35:27 -07:00 committed by TensorFlower Gardener
parent 265f118243
commit 0d1a1413c8
2 changed files with 2 additions and 2 deletions

View File

@ -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_;

View File

@ -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