From 1c4735aed9442a8e442214a23a3df94bd8fc99b5 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 16 Nov 2017 22:08:07 +0000 Subject: Convert ByteString::{Format|FormatV} to static methods This CL moves the Format and FormatV methods of ByteString to be static. Bug: pdfium:934 Change-Id: I9c30455a789aff9f619b9d5bf89c0712644f2d9a Reviewed-on: https://pdfium-review.googlesource.com/18650 Commit-Queue: dsinclair Reviewed-by: Tom Sepez --- fpdfsdk/cpdfsdk_datetime.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'fpdfsdk/cpdfsdk_datetime.cpp') diff --git a/fpdfsdk/cpdfsdk_datetime.cpp b/fpdfsdk/cpdfsdk_datetime.cpp index ce22cae12f..332ae8e62e 100644 --- a/fpdfsdk/cpdfsdk_datetime.cpp +++ b/fpdfsdk/cpdfsdk_datetime.cpp @@ -264,16 +264,11 @@ CPDFSDK_DateTime& CPDFSDK_DateTime::FromPDFDateTimeString( } ByteString CPDFSDK_DateTime::ToCommonDateTimeString() { - ByteString str1; - str1.Format("%04d-%02u-%02u %02u:%02u:%02u ", m_year, m_month, m_day, m_hour, - m_minute, m_second); - if (m_tzHour < 0) - str1 += "-"; - else - str1 += "+"; - ByteString str2; - str2.Format("%02d:%02u", std::abs(static_cast(m_tzHour)), m_tzMinute); - return str1 + str2; + return ByteString::Format("%04d-%02u-%02u %02u:%02u:%02u ", m_year, m_month, + m_day, m_hour, m_minute, m_second) + + (m_tzHour < 0 ? "-" : "+") + + ByteString::Format("%02d:%02u", std::abs(static_cast(m_tzHour)), + m_tzMinute); } ByteString CPDFSDK_DateTime::ToPDFDateTimeString() { -- cgit v1.2.3