(self, key)
| 60 | return (oldhash+1)%size |
| 61 | |
| 62 | def get(self, key): |
| 63 | startslot = self.hashfunction(key, len(self.slots)) |
| 64 | |
| 65 | data = None |
| 66 | stop = False |
| 67 | found = False |
| 68 | position = startslot |
| 69 | while self.slots[position] != None and not found and not stop: |
| 70 | if self.slots[position] == key: |
| 71 | found = True |
| 72 | data = self.data[position] |
| 73 | else: |
| 74 | position = self.rehash(position, len(self.slots)) |
| 75 | if position == startslot: |
| 76 | stop = True |
| 77 | return data |
| 78 | |
| 79 | def __getitem__(self, key): |
| 80 | return self.get(key) |
no test coverage detected