summaryrefslogtreecommitdiff
path: root/worldtime_protocol/timezone.cpp
diff options
context:
space:
mode:
author(no author) <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10>2010-04-04 23:41:11 +0000
committer(no author) <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10>2010-04-04 23:41:11 +0000
commit0c2db8f67782848603cdd845713ca70e285c0f49 (patch)
tree9ee0652d8c23593b567b91cd5e34c13c62d61611 /worldtime_protocol/timezone.cpp
parentd11bac94bbcbd92bf550ccca094a10bb50e6df4b (diff)
Fixed incorrect time after time zone table changes
Reduced size plugin size git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@487 4f64403b-2f21-0410-a795-97e2b3489a10
Diffstat (limited to 'worldtime_protocol/timezone.cpp')
-rw-r--r--worldtime_protocol/timezone.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/worldtime_protocol/timezone.cpp b/worldtime_protocol/timezone.cpp
index 5b2c31b..41a84c0 100644
--- a/worldtime_protocol/timezone.cpp
+++ b/worldtime_protocol/timezone.cpp
@@ -1,11 +1,11 @@
#include "common.h"
#include "timezone.h"
-TimeList timezone_list, geo_timezone_list;
+TimeList timezone_list(10), geo_timezone_list(10, LS_TZREG::compare);
-bool LS_TZREG::operator<(const LS_TZREG &other) {
+int LS_TZREG::compare(const LS_TZREG *p1, const LS_TZREG *p2) {
//return Index < other.Index;
- return TZI.Bias < other.TZI.Bias;
+ return p1->TZI.Bias - p2->TZI.Bias;
}
bool build_timezone_list() {
@@ -53,7 +53,8 @@ bool build_timezone_list() {
RegCloseKey(KKtz);
Temp.list_index = dwIndex;
- timezone_list.push_back(Temp);
+ timezone_list.insert(new LS_TZREG(Temp));
+ geo_timezone_list.insert(new LS_TZREG(Temp));
dwcbName = MAX_SIZE;
dwIndex++;
@@ -61,9 +62,6 @@ bool build_timezone_list() {
RegCloseKey(HKlmtz);
- geo_timezone_list = timezone_list;
- std::sort(geo_timezone_list.begin(), geo_timezone_list.end());
-
return true;
}