Make CFX_WideString::FromLocal() take a CFX_ByteStringC arg
It doesn't persist the string beyond the duration of the
call, hence it should take the *StringC variant. Doing so
avoids some allocs by changing to the *StringC ctor in a few
places, at the cost of some explicit .ToByteStringC() calls
(which are cheap).
Review URL: https://codereview.chromium.org/1862953004
diff --git a/fpdfsdk/javascript/PublicMethods.cpp b/fpdfsdk/javascript/PublicMethods.cpp
index 308163d..d5b961d 100644
--- a/fpdfsdk/javascript/PublicMethods.cpp
+++ b/fpdfsdk/javascript/PublicMethods.cpp
@@ -837,7 +837,7 @@
}
// for processing currency string
- Value = CFX_WideString::FromLocal(strValue);
+ Value = CFX_WideString::FromLocal(strValue.AsByteStringC());
std::wstring strValue2 = Value.c_str();
if (bCurrencyPrepend)
@@ -1120,7 +1120,7 @@
if (iNegative)
strValue = "-" + strValue;
strValue += "%";
- Value = CFX_WideString::FromLocal(strValue);
+ Value = CFX_WideString::FromLocal(strValue.AsByteStringC());
#endif
return TRUE;
}