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

Commit e3aef3dd authored by Tom Cherry's avatar Tom Cherry Committed by Gerrit Code Review
Browse files

Merge "init: enable C++17"

parents 26afd169 2bc00140
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ init_cflags += \
    -Wall -Wextra \
    -Wno-unused-parameter \
    -Werror \
    -std=gnu++1z \

# --

+5 −8
Original line number Diff line number Diff line
@@ -146,8 +146,7 @@ bool Action::ParsePropertyTrigger(const std::string& trigger, std::string* err)
    std::string prop_value(prop_name.substr(equal_pos + 1));
    prop_name.erase(equal_pos);

    auto res = property_triggers_.emplace(prop_name, prop_value);
    if (res.second == false) {
    if (auto [it, inserted] = property_triggers_.emplace(prop_name, prop_value); !inserted) {
        *err = "multiple property triggers found for same property";
        return false;
    }
@@ -212,9 +211,7 @@ bool Action::CheckPropertyTriggers(const std::string& name,
    }

    bool found = name.empty();
    for (const auto& t : property_triggers_) {
        const auto& trigger_name = t.first;
        const auto& trigger_value = t.second;
    for (const auto& [trigger_name, trigger_value] : property_triggers_) {
        if (trigger_name == name) {
            if (trigger_value != "*" && trigger_value != value) {
                return false;
@@ -251,10 +248,10 @@ bool Action::TriggersEqual(const Action& other) const {
std::string Action::BuildTriggersString() const {
    std::string result;

    for (const auto& t : property_triggers_) {
        result += t.first;
    for (const auto& [trigger_name, trigger_value] : property_triggers_) {
        result += trigger_name;
        result += '=';
        result += t.second;
        result += trigger_value;
        result += ' ';
    }
    if (!event_trigger_.empty()) {