Removing wstringstream usage since it adds unnecessary overhead (#908)
This commit is contained in:
committed by
Matt Cooley
parent
f9c049a84b
commit
8141941208
@@ -263,8 +263,7 @@ namespace GraphControl
|
||||
|
||||
if (!validEqs.empty())
|
||||
{
|
||||
wstringstream ss{};
|
||||
ss << s_getGraphOpeningTags;
|
||||
request = s_getGraphOpeningTags;
|
||||
|
||||
int numValidEquations = 0;
|
||||
for (Equation ^ eq : validEqs)
|
||||
@@ -276,15 +275,13 @@ namespace GraphControl
|
||||
|
||||
if (numValidEquations++ > 0)
|
||||
{
|
||||
ss << L"<mo>,</mo>";
|
||||
request += L"<mo>,</mo>";
|
||||
}
|
||||
|
||||
ss << eq->GetRequest()->Data();
|
||||
request += eq->GetRequest()->Data();
|
||||
}
|
||||
|
||||
ss << s_getGraphClosingTags;
|
||||
|
||||
request = ss.str();
|
||||
request += s_getGraphClosingTags;
|
||||
}
|
||||
|
||||
if (graphExpression = m_solver->ParseInput(request))
|
||||
@@ -374,14 +371,11 @@ namespace GraphControl
|
||||
{
|
||||
shared_ptr<Graphing::IGraph> graph = m_solver->CreateGrapher();
|
||||
|
||||
wstringstream ss{};
|
||||
ss << s_getGraphOpeningTags;
|
||||
ss << equation->GetRequest()->Data();
|
||||
ss << s_getGraphClosingTags;
|
||||
wstring request = s_getGraphOpeningTags;
|
||||
request += equation->GetRequest()->Data();
|
||||
request += s_getGraphClosingTags;
|
||||
|
||||
wstring request = ss.str();
|
||||
unique_ptr<IExpression> graphExpression;
|
||||
if (graphExpression = m_solver->ParseInput(request))
|
||||
if (unique_ptr<IExpression> graphExpression = m_solver->ParseInput(request))
|
||||
{
|
||||
if (graph->TryInitialize(graphExpression.get()))
|
||||
{
|
||||
|
Reference in New Issue
Block a user