From c995eb7c195f12a155f5e21197e96caa07744c31 Mon Sep 17 00:00:00 2001
From: "Mirar (Pontus Hagland)" <pike@sort.mirar.org>
Date: Thu, 27 May 1999 18:40:38 +0200
Subject: [PATCH] hash stuff added

Rev: lib/modules/Calendar.pmod/Gregorian.pmod:1.19
---
 lib/modules/Calendar.pmod/Gregorian.pmod | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/lib/modules/Calendar.pmod/Gregorian.pmod b/lib/modules/Calendar.pmod/Gregorian.pmod
index 22a131736a..5b4dd82495 100644
--- a/lib/modules/Calendar.pmod/Gregorian.pmod
+++ b/lib/modules/Calendar.pmod/Gregorian.pmod
@@ -100,6 +100,8 @@ class Year
 	 (int)x==y;
    }
 
+   int hash() { return y*113; }
+
    int `>(object x)
    {
       return y>(int)x;
@@ -332,6 +334,8 @@ class Month
 	 x->y==y && x->m==m;
    }
 
+   int hash() { return y*4721+m; }
+
    int `>(object x)
    {
       return 
@@ -479,6 +483,8 @@ class Week
 	 x->y==y && x->w==w;
    }
 
+   int hash() { return y*811+w; }
+
    int `>(object x)
    {
       return 
@@ -678,6 +684,8 @@ class Day
 	 (x->julian_day() == julian_day());
    }
 
+   int hash() { return y*3203+d; }
+
    int `>(object x)
    {
       return 
@@ -875,6 +883,8 @@ class Hour
 	 x->d==d && x->h==h;
    }
 
+   int hash() { return d->__hash()*31957+h; }
+
    int `>(object x)
    {
       return 
@@ -1056,6 +1066,8 @@ class Minute
 	 x->h==h && x->m==m;
    }
 
+   int __hash() { return h->__hash()*101+m; }
+
    int `>(object x)
    {
       return 
@@ -1261,6 +1273,8 @@ class Second
 	 x->m==m && x->s==s;
    }
 
+   int __hash() { return m->__hash()*101+s; }
+
    int `>(object x)
    {
       return 
-- 
GitLab