Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Unified Diff: third_party/protobuf/src/google/protobuf/stubs/statusor.h

Issue 1983203003: Update third_party/protobuf to protobuf-v3.0.0-beta-3 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: owners Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/protobuf/src/google/protobuf/stubs/statusor.h
diff --git a/third_party/protobuf/src/google/protobuf/stubs/statusor.h b/third_party/protobuf/src/google/protobuf/stubs/statusor.h
index a9d2b374bf9a0ec58067f2895a3d8c378a77e898..29f869ad5e8d58a334c8cf7067e83027cf9b9e61 100644
--- a/third_party/protobuf/src/google/protobuf/stubs/statusor.h
+++ b/third_party/protobuf/src/google/protobuf/stubs/statusor.h
@@ -224,14 +224,14 @@ inline StatusOr<T>& StatusOr<T>::operator=(const StatusOr<T>& other) {
template<typename T>
template<typename U>
inline StatusOr<T>::StatusOr(const StatusOr<U>& other)
- : status_(other.status_), value_(other.value_) {
+ : status_(other.status_), value_(other.status_.ok() ? other.value_ : T()) {
}
template<typename T>
template<typename U>
inline StatusOr<T>& StatusOr<T>::operator=(const StatusOr<U>& other) {
status_ = other.status_;
- value_ = other.value_;
+ if (status_.ok()) value_ = other.value_;
return *this;
}
« no previous file with comments | « third_party/protobuf/src/google/protobuf/stubs/port.h ('k') | third_party/protobuf/src/google/protobuf/stubs/stringpiece.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698