From b7022514313c41df469723f814681b74fa32f3c6 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 8 Jul 2012 14:38:13 -0400 Subject: [PATCH] Performance - When there is only one element in A3, no point firing up the Dijkstra shunt of the infix processing. --- src/A3.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/A3.cpp b/src/A3.cpp index f64018459..607e927ac 100644 --- a/src/A3.cpp +++ b/src/A3.cpp @@ -892,6 +892,9 @@ const A3 A3::tokenize (const A3& input) const // const A3 A3::infix (const A3& input) const { + if (input.size () == 1) + return input; + Arg previous ("?", Arg::cat_op); A3 modified; @@ -1229,6 +1232,9 @@ const A3 A3::sequence (const A3& input) const // const A3 A3::postfix (const A3& input) const { + if (input.size () == 1) + return input; + A3 converted; converted._limit = input._limit;