Moved getValueAsString call from last commit into earlier check for "%s"

This commit is contained in:
2023-10-16 08:59:36 -05:00
parent caba27448d
commit b1c287a4e2

View File

@ -112,6 +112,12 @@ public class QValueFormatter
{
return formatLocalTime(lt);
}
//////////////////////////////////////////////////////////////////////////////////////////
// else, just return the value as a string, rather than going through String.formatted //
// this saves some overhead incurred by String.formatted when called millions of times. //
//////////////////////////////////////////////////////////////////////////////////////////
return (ValueUtils.getValueAsString(value));
}
////////////////////////////////////////////////////////
@ -119,15 +125,6 @@ public class QValueFormatter
////////////////////////////////////////////////////////
if(StringUtils.hasContent(displayFormat))
{
//////////////////////////////////////////////////////////////////////////////////////////
// if the format is %s (the default), just return value a string //
// this saves some overhead incurred by String.formatted when called millions of times. //
//////////////////////////////////////////////////////////////////////////////////////////
if(displayFormat.equals("%s"))
{
return (ValueUtils.getValueAsString(value));
}
try
{
return (displayFormat.formatted(value));