Skip to content
Snippets Groups Projects
Commit c995eb7c authored by Mirar (Pontus Hagland)'s avatar Mirar (Pontus Hagland)
Browse files

hash stuff added

Rev: lib/modules/Calendar.pmod/Gregorian.pmod:1.19
parent 085ac6fe
No related branches found
No related tags found
No related merge requests found
...@@ -100,6 +100,8 @@ class Year ...@@ -100,6 +100,8 @@ class Year
(int)x==y; (int)x==y;
} }
int hash() { return y*113; }
int `>(object x) int `>(object x)
{ {
return y>(int)x; return y>(int)x;
...@@ -332,6 +334,8 @@ class Month ...@@ -332,6 +334,8 @@ class Month
x->y==y && x->m==m; x->y==y && x->m==m;
} }
int hash() { return y*4721+m; }
int `>(object x) int `>(object x)
{ {
return return
...@@ -479,6 +483,8 @@ class Week ...@@ -479,6 +483,8 @@ class Week
x->y==y && x->w==w; x->y==y && x->w==w;
} }
int hash() { return y*811+w; }
int `>(object x) int `>(object x)
{ {
return return
...@@ -678,6 +684,8 @@ class Day ...@@ -678,6 +684,8 @@ class Day
(x->julian_day() == julian_day()); (x->julian_day() == julian_day());
} }
int hash() { return y*3203+d; }
int `>(object x) int `>(object x)
{ {
return return
...@@ -875,6 +883,8 @@ class Hour ...@@ -875,6 +883,8 @@ class Hour
x->d==d && x->h==h; x->d==d && x->h==h;
} }
int hash() { return d->__hash()*31957+h; }
int `>(object x) int `>(object x)
{ {
return return
...@@ -1056,6 +1066,8 @@ class Minute ...@@ -1056,6 +1066,8 @@ class Minute
x->h==h && x->m==m; x->h==h && x->m==m;
} }
int __hash() { return h->__hash()*101+m; }
int `>(object x) int `>(object x)
{ {
return return
...@@ -1261,6 +1273,8 @@ class Second ...@@ -1261,6 +1273,8 @@ class Second
x->m==m && x->s==s; x->m==m && x->s==s;
} }
int __hash() { return m->__hash()*101+s; }
int `>(object x) int `>(object x)
{ {
return return
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment