remove some wcstring -> wchar_t* -> wcstring conversions

Mostly related to usage _(L"foo"), keeping in mind the _
macro does a wcstring().c_str() already.

And a smattering of other trivial micro-optimizations certain
to not help tangibly.
This commit is contained in:
Aaron Gyes
2019-03-14 15:12:14 -07:00
parent 4a67d9015b
commit d837eee09d
18 changed files with 35 additions and 37 deletions

View File

@@ -17,7 +17,8 @@
#include "tokenizer.h"
#include "wutil.h" // IWYU pragma: keep
wcstring tokenizer_get_error_message(tokenizer_error_t err) {
// _(s) is already wgettext(s).c_str(), so let's not convert back to wcstring
const wchar_t * tokenizer_get_error_message(tokenizer_error_t err) {
switch (err) {
case tokenizer_error_t::none:
return L"";
@@ -47,7 +48,7 @@ wcstring tokenizer_get_error_message(tokenizer_error_t err) {
return _(L"Unexpected ')' found, expecting '}'");
}
assert(0 && "Unexpected tokenizer error");
return NULL;
return nullptr;
}
// Whether carets redirect stderr.