Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e20137fc authored by Jooyung Han's avatar Jooyung Han Committed by Gerrit Code Review
Browse files

Merge "midi: Use std::optional instead of std::unique_ptr"

parents 6ef6648c aac823d7
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -90,13 +90,13 @@ status_t MidiDeviceInfo::readFromParcel(const Parcel* parcel) {

status_t MidiDeviceInfo::readStringVector(
        const Parcel* parcel, Vector<String16> *vectorPtr, size_t defaultLength) {
    std::unique_ptr<std::vector<std::unique_ptr<String16>>> v;
    std::optional<std::vector<std::optional<String16>>> v;
    status_t result = parcel->readString16Vector(&v);
    if (result != OK) return result;
    vectorPtr->clear();
    if (v.get() != nullptr) {
    if (v) {
        for (const auto& iter : *v) {
            if (iter.get() != nullptr) {
            if (iter) {
                vectorPtr->push_back(*iter);
            } else {
                vectorPtr->push_back(String16());