aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2015-03-14 22:33:26 -0500
committerCharles Kerr <charles.kerr@canonical.com>2015-03-14 22:33:26 -0500
commit61b00f51d58678c0a265c9e4a0fd35354fe5dc90 (patch)
treec1aa3e6300ef261ea96a9b31417aea3222e00a25
parentb4e12a64cf1347bd9ca5d7b426f0f0591440d498 (diff)
downloadayatana-indicator-datetime-61b00f51d58678c0a265c9e4a0fd35354fe5dc90.tar.gz
ayatana-indicator-datetime-61b00f51d58678c0a265c9e4a0fd35354fe5dc90.tar.bz2
ayatana-indicator-datetime-61b00f51d58678c0a265c9e4a0fd35354fe5dc90.zip
in DateTime::Local() and DateTime::NowLocal(), avoid redundant construction of the local timezone.
-rw-r--r--src/date-time.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/date-time.cpp b/src/date-time.cpp
index 33b1590..46591e6 100644
--- a/src/date-time.cpp
+++ b/src/date-time.cpp
@@ -57,7 +57,7 @@ DateTime::DateTime(time_t t)
DateTime DateTime::NowLocal()
{
auto gtz = g_time_zone_new_local();
- auto gdt = g_date_time_new_now_local();
+ auto gdt = g_date_time_new_now(gtz);
DateTime dt(gtz, gdt);
g_time_zone_unref(gtz);
g_date_time_unref(gdt);
@@ -67,7 +67,7 @@ DateTime DateTime::NowLocal()
DateTime DateTime::Local(int year, int month, int day, int hour, int minute, int seconds)
{
auto gtz = g_time_zone_new_local();
- auto gdt = g_date_time_new_local (year, month, day, hour, minute, seconds);
+ auto gdt = g_date_time_new(gtz, year, month, day, hour, minute, seconds);
DateTime dt(gtz, gdt);
g_time_zone_unref(gtz);
g_date_time_unref(gdt);