[apps, poincare] Optimize the preferences singletons' usage by removing superfluous checks in the setters, and performing manual CSE in the callers.

Signed-off-by: Lionel Debroux <lionel_debroux@yahoo.fr>
This commit is contained in:
Lionel Debroux
2018-10-19 23:01:16 +02:00
committed by EmilieNumworks
parent ddebc06fa5
commit 70a8d06cfe
10 changed files with 50 additions and 49 deletions

View File

@@ -144,7 +144,8 @@ Calculation::EqualSign Calculation::exactAndApproximateDisplayedOutputsAreEqual(
return m_equalSign;
}
char buffer[k_printedExpressionSize];
m_equalSign = exactOutput(context).isEqualToItsApproximationLayout(approximateOutput(context), buffer, k_printedExpressionSize, Preferences::sharedPreferences()->angleUnit(), Preferences::sharedPreferences()->displayMode(), Preferences::sharedPreferences()->numberOfSignificantDigits(), *context) ? EqualSign::Equal : EqualSign::Approximation;
Preferences * preferences = Preferences::sharedPreferences();
m_equalSign = exactOutput(context).isEqualToItsApproximationLayout(approximateOutput(context), buffer, k_printedExpressionSize, preferences->angleUnit(), preferences->displayMode(), preferences->numberOfSignificantDigits(), *context) ? EqualSign::Equal : EqualSign::Approximation;
return m_equalSign;
}