From f56c1107e00f8e3e82939dbee0fcd5cb7e3ab3c8 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 30 Aug 2020 10:12:21 +1000 Subject: [PATCH] Fix face attributes to string conversion with F shorthand Previously a `F` attribute would end up being converted to Ffga which is confusing as F *means* fga. --- src/face_registry.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/face_registry.cc b/src/face_registry.cc index 53f059aa..9a70f936 100644 --- a/src/face_registry.cc +++ b/src/face_registry.cc @@ -76,8 +76,12 @@ String to_string(Attribute attributes) }; auto filteredAttrs = attrs | - filter([=](const Attr& a) { return attributes & a.attr; }) | - transform([](const Attr& a) { return a.name; }); + filter([&](const Attr& a) { + if ((attributes & a.attr) != a.attr) + return false; + attributes &= ~a.attr; + return true; + }) | transform([](const Attr& a) { return a.name; }); return accumulate(filteredAttrs, "+"_str, std::plus<>{}); }