From ac13946ffbec538f5fc193843fae7dd513b9c58e Mon Sep 17 00:00:00 2001 From: couriersud Date: Thu, 30 Mar 2017 20:20:00 +0200 Subject: 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) --- src/lib/netlist/plib/pfunction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/netlist/plib/pfunction.cpp') 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 &inputs, const pstring { // Shunting-yard infix parsing std::vector sep = {"(", ")", ",", "*", "/", "+", "-", "^"}; - std::vector sexpr(plib::psplit(expr.replace(" ",""), sep)); + std::vector sexpr(plib::psplit(expr.replace_all(" ",""), sep)); std::stack opstk; std::vector postfix; -- cgit v1.2.3-70-g09d2