diff options
author | 2020-11-05 17:18:45 +0000 | |
---|---|---|
committer | 2020-11-05 17:18:45 +0000 | |
commit | b1d6aaa8a57ab386fbcf47b6de7ed69c691e908a (patch) | |
tree | b4a0d2cfdf1bc41c71934f34a98077e3adfc8b3a | |
parent | 18d7a9092300e0cdc5d562413b9292d788ea08ef (diff) | |
parent | 46f79a21dca27e6cc6e12d39c3258959b689f20c (diff) |
Merge "libgui: no use readString16Inplace"
-rw-r--r-- | libs/gui/view/Surface.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/libs/gui/view/Surface.cpp b/libs/gui/view/Surface.cpp index d64dfd55be..d98ffc6618 100644 --- a/libs/gui/view/Surface.cpp +++ b/libs/gui/view/Surface.cpp @@ -72,13 +72,9 @@ status_t Surface::readFromParcel(const Parcel* parcel, bool nameAlreadyRead) { } String16 Surface::readMaybeEmptyString16(const Parcel* parcel) { - size_t len; - const char16_t* str = parcel->readString16Inplace(&len); - if (str != nullptr) { - return String16(str, len); - } else { - return String16(); - } + std::optional<String16> str; + parcel->readString16(&str); + return str.value_or(String16()); } } // namespace view |