summaryrefslogtreecommitdiffstats
path: root/src/layers.cpp
diff options
context:
space:
mode:
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-07-28 15:06:42 +0200
committerMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-08-08 17:24:00 +0200
commit688d3bead2846824b2cbf5596d65dec5690a035d (patch)
tree14a84f95d49792560fe3446a9bd015e153d79776 /src/layers.cpp
parentb1086ca88caec808780162f068b04a8e9af89b58 (diff)
layers: clang-format
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
Diffstat (limited to 'src/layers.cpp')
-rw-r--r--src/layers.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/layers.cpp b/src/layers.cpp
index 0d01080..5e7256e 100644
--- a/src/layers.cpp
+++ b/src/layers.cpp
@@ -31,14 +31,13 @@ struct result<struct surface_id_to_layer_map> to_surface_id_to_layer_map(
surface_id_to_layer_map stl{};
auto m = j["mappings"];
stl.layers.reserve(m.size());
- std::transform(
- std::cbegin(m), std::cend(m),
- std::inserter(stl.mapping, stl.mapping.end()),
- [&stl](nlohmann::json const &j) {
- auto k = surface_id_to_layer(j);
- stl.layers.push_back(unsigned(k.layer_id));
- return k;
- });
+ std::transform(std::cbegin(m), std::cend(m),
+ std::inserter(stl.mapping, stl.mapping.end()),
+ [&stl](nlohmann::json const &j) {
+ auto k = surface_id_to_layer(j);
+ stl.layers.push_back(unsigned(k.layer_id));
+ return k;
+ });
// XXX need to sort layers?
for (auto i : stl.mapping) {
if (i.name.empty()) {
@@ -54,15 +53,16 @@ struct result<struct surface_id_to_layer_map> to_surface_id_to_layer_map(
// Check lookup
auto jtests = j.value("tests", json());
- if (! jtests.empty()) {
+ if (!jtests.empty()) {
DB("Embedded tests...");
std::vector<std::pair<int, int>> tests;
tests.reserve(jtests.size());
std::transform(std::cbegin(jtests), std::cend(jtests),
std::back_inserter(tests), [](json const &j) {
- return std::make_pair(get<int>(j["surface_id"]),
- get<int>(j["expect_layer_id"]));
- });
+ return std::make_pair(
+ get<int>(j["surface_id"]),
+ get<int>(j["expect_layer_id"]));
+ });
for (auto sid : tests) {
int lid = stl.get_layer_for_surface(sid.first).value_or(-1);
@@ -70,7 +70,7 @@ struct result<struct surface_id_to_layer_map> to_surface_id_to_layer_map(
<< ", expect=" << sid.second);
if (lid != sid.second) {
return Err<surface_id_to_layer_map>(
- "ID Map embedded test failed!");
+ "ID Map embedded test failed!");
}
}
}