Ecere Software
/
sdk
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f8517bb
)
ecere/sys/Date: OnCompare method (optimization)
author
Jerome St-Louis
<jerome@ecere.com>
Wed, 9 Dec 2015 23:12:31 +0000
(18:12 -0500)
committer
Jerome St-Louis
<jerome@ecere.com>
Mon, 21 Dec 2015 19:07:29 +0000
(14:07 -0500)
ecere/src/sys/Date.ec
patch
|
blob
|
history
diff --git
a/ecere/src/sys/Date.ec
b/ecere/src/sys/Date.ec
index
c869d55
..
cb541d0
100644
(file)
--- a/
ecere/src/sys/Date.ec
+++ b/
ecere/src/sys/Date.ec
@@
-92,6
+92,17
@@
public struct Date
Month month;
int day;
+ int OnCompare(Date b)
+ {
+ if(year > b.year) return 1;
+ if(year < b.year) return -1;
+ if(month > b.month) return 1;
+ if(month < b.month) return -1;
+ if(day > b.day) return 1;
+ if(day < b.day) return -1;
+ return 0;
+ }
+
const char * OnGetString(char * stringOutput, void * fieldData, bool * needClass)
{
if(stringOutput)