diff options
author | Ben Gamari <bgamari.foss@gmail.com> | 2015-11-03 16:16:27 -0600 |
---|---|---|
committer | Austin Seipp <austin@well-typed.com> | 2015-11-03 16:16:30 -0600 |
commit | 334fe4500c234e83f250f74679f7bbe20208abba (patch) | |
tree | 2fad3f32a81b9fe2a4b0eaa3dd4026728851ab1d /rts/Hash.h | |
parent | b62605e53c167719b3bf8842eba628061cf22dd1 (diff) | |
download | haskell-334fe4500c234e83f250f74679f7bbe20208abba.tar.gz |
rts/Hash: Constify HashTable* in lookupHashTable
This seems like an obvious place to apply `const`
Reviewed By: simonmar, austin
Differential Revision: https://phabricator.haskell.org/D1416
Diffstat (limited to 'rts/Hash.h')
-rw-r--r-- | rts/Hash.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/rts/Hash.h b/rts/Hash.h index 136f94a18c..c2dfc26d6d 100644 --- a/rts/Hash.h +++ b/rts/Hash.h @@ -15,7 +15,7 @@ typedef struct hashtable HashTable; /* abstract */ /* Hash table access where the keys are StgWords */ HashTable * allocHashTable ( void ); -void * lookupHashTable ( HashTable *table, StgWord key ); +void * lookupHashTable ( const HashTable *table, StgWord key ); void insertHashTable ( HashTable *table, StgWord key, void *data ); void * removeHashTable ( HashTable *table, StgWord key, void *data ); @@ -44,11 +44,11 @@ HashTable * allocStrHashTable ( void ); (removeHashTable(table, (StgWord)key, data)) /* Hash tables for arbitrary keys */ -typedef int HashFunction(HashTable *table, StgWord key); +typedef int HashFunction(const HashTable *table, StgWord key); typedef int CompareFunction(StgWord key1, StgWord key2); HashTable * allocHashTable_(HashFunction *hash, CompareFunction *compare); -int hashWord(HashTable *table, StgWord key); -int hashStr(HashTable *table, char *key); +int hashWord(const HashTable *table, StgWord key); +int hashStr(const HashTable *table, char *key); /* Freeing hash tables */ |