diff options
-rw-r--r-- | libformat/libformat/format.cxx | 21 | ||||
-rw-r--r-- | libmformat/libmformat/format.cxx | 21 |
2 files changed, 20 insertions, 22 deletions
diff --git a/libformat/libformat/format.cxx b/libformat/libformat/format.cxx index 53530a8..d1c18bc 100644 --- a/libformat/libformat/format.cxx +++ b/libformat/libformat/format.cxx @@ -14,17 +14,16 @@ namespace format { string r (g); - auto tr = [&r] (char (*t) (char)) - { - transform (r.begin (), r.end (), r.begin (), t); - }; - - switch (v) - { - case volume::quiet: tr ([](char c) -> char {return tolower (c);}); break; - case volume::normal: break; - case volume::loud: tr ([](char c) -> char {return toupper (c);}); break; - } + transform (r.begin (), r.end (), r.begin (), + [v] (char c) -> char + { + switch (v) + { + case volume::quiet: return tolower (c); + case volume::normal: return c; + case volume::loud: return toupper (c); + } + }); return r += ", " + n + '!'; } diff --git a/libmformat/libmformat/format.cxx b/libmformat/libmformat/format.cxx index fe6ad15..181eb86 100644 --- a/libmformat/libmformat/format.cxx +++ b/libmformat/libmformat/format.cxx @@ -14,17 +14,16 @@ namespace format { string r (g); - auto tr = [&r] (char (*t) (char)) - { - transform (r.begin (), r.end (), r.begin (), t); - }; - - switch (v) - { - case volume::quiet: tr ([](char c) -> char {return tolower (c);}); break; - case volume::normal: break; - case volume::loud: tr ([](char c) -> char {return toupper (c);}); break; - } + transform (r.begin (), r.end (), r.begin (), + [v] (char c) -> char + { + switch (v) + { + case volume::quiet: return tolower (c); + case volume::normal: return c; + case volume::loud: return toupper (c); + } + }); return r += ", " + n + '!'; } |