diff options
author | 2020-09-05 19:43:54 +0200 | |
---|---|---|
committer | 2020-09-05 21:31:49 +0200 | |
commit | f3eb6324652fea263972087146fbdde9e32f9a0f (patch) | |
tree | f63d352948c3a4fcf62857839cc5c5359804b0f5 /src/lib/netlist/plib/poptions.cpp | |
parent | 4dd7e21f565b12e8487b884089d769f0b30147c6 (diff) |
netlist: code maintenance and performance optimizations.
* rename some misleading type names
* remove callback_t and replace by better scalable approach
* hide implementations details
* move sources classes from putil.h to psources.h
* reduce code complexity
* improve parsing performance, parsing netlists now is twice as fast.
* fix issues around multi-byte string support
* moved psplit into pstrutil.h
Diffstat (limited to 'src/lib/netlist/plib/poptions.cpp')
-rw-r--r-- | src/lib/netlist/plib/poptions.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/netlist/plib/poptions.cpp b/src/lib/netlist/plib/poptions.cpp index c22076f6d0c..c8b99f12077 100644 --- a/src/lib/netlist/plib/poptions.cpp +++ b/src/lib/netlist/plib/poptions.cpp @@ -95,14 +95,14 @@ namespace plib { for (std::size_t i=1; i < argv.size(); ) { - putf8string arg(argv[i]); + pstring arg(argv[i]); option *opt = nullptr; - putf8string opt_arg; + pstring opt_arg; bool has_equal_arg = false; if (!seen_other_args && plib::startsWith(arg, "--")) { - auto v = psplit(arg.substr(2),"="); + auto v = psplit(arg.substr(2),'='); if (!v.empty() && !v[0].empty()) { opt = getopt_long(v[0]); @@ -171,13 +171,13 @@ namespace plib { pstring options::split_paragraphs(const pstring &text, unsigned width, unsigned indent, unsigned firstline_indent, const pstring &line_end) { - auto paragraphs = psplit(text,"\n"); + auto paragraphs = psplit(text,'\n'); pstring ret(""); for (auto &p : paragraphs) { pstring line = plib::rpad(pstring(""), pstring(" "), firstline_indent); - for (auto &s : psplit(p, " ")) + for (auto &s : psplit(p, ' ')) { if (line.length() + s.length() > width) { @@ -263,7 +263,7 @@ namespace plib { ex += split_paragraphs(example->help(), width, 4, 4) + "\n\n"; } } - if (ex.length() > 0) + if (!ex.empty()) { ret += "\n\nExamples:\n\n" + ex; } |