diff options
author | 2017-03-30 20:20:00 +0200 | |
---|---|---|
committer | 2017-03-30 22:06:03 +0200 | |
commit | ac13946ffbec538f5fc193843fae7dd513b9c58e (patch) | |
tree | 44ee3cdb306b6cbd214c12bd8cb46dc1e6e6fb19 /src/lib/netlist/plib/pfunction.cpp | |
parent | ac856bc4d1d22a4be0cd8c86ec7da66761becc96 (diff) |
Change pstring to use std::string as storage container.
This removes all allocation code from pstring. const_iterator is
consequently now based on pstring::const_iterator.
Removed pstring_buffer. This was class wasn't a good idea.
Vas was right: This change did not impact runtime performance. Startup
performance (string intensive) increased. (nw)
Diffstat (limited to 'src/lib/netlist/plib/pfunction.cpp')
-rw-r--r-- | src/lib/netlist/plib/pfunction.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/netlist/plib/pfunction.cpp b/src/lib/netlist/plib/pfunction.cpp index 7113a6e07fb..c369dc2ed90 100644 --- a/src/lib/netlist/plib/pfunction.cpp +++ b/src/lib/netlist/plib/pfunction.cpp @@ -86,7 +86,7 @@ static int get_prio(pstring v) { if (v == "(" || v == ")") return 1; - else if (v.left(std::next(v.begin(),1)) >= "a" && v.left(std::next(v.begin(),1)) <= "z") + else if (v.left(1) >= "a" && v.left(1) <= "z") return 0; else if (v == "*" || v == "/") return 20; @@ -111,7 +111,7 @@ void pfunction::compile_infix(const std::vector<pstring> &inputs, const pstring { // Shunting-yard infix parsing std::vector<pstring> sep = {"(", ")", ",", "*", "/", "+", "-", "^"}; - std::vector<pstring> sexpr(plib::psplit(expr.replace(" ",""), sep)); + std::vector<pstring> sexpr(plib::psplit(expr.replace_all(" ",""), sep)); std::stack<pstring> opstk; std::vector<pstring> postfix; |