From f465d006a235214974ad19d9864007e7af6fa56f Mon Sep 17 00:00:00 2001 From: havoc Date: Tue, 25 Sep 2007 18:52:03 +0000 Subject: [PATCH] use bigger prime numbers in calculating vertex hash indices to improve loading performance git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7586 d7cf8633-e32d-0410-b094-e92efae38249 --- model_shared.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model_shared.c b/model_shared.c index b5276236..16bc5022 100644 --- a/model_shared.c +++ b/model_shared.c @@ -818,7 +818,7 @@ int Mod_ShadowMesh_AddVertex(shadowmesh_t *mesh, float *vertex14f) int hashindex, vnum; shadowmeshvertexhash_t *hash; // this uses prime numbers intentionally - hashindex = (unsigned int) (vertex14f[0] * 3 + vertex14f[1] * 5 + vertex14f[2] * 7) % SHADOWMESHVERTEXHASH; + hashindex = (unsigned int) (vertex14f[0] * 29 + vertex14f[1] * 71 + vertex14f[2] * 113) % SHADOWMESHVERTEXHASH; for (hash = mesh->vertexhashtable[hashindex];hash;hash = hash->next) { vnum = (hash - mesh->vertexhashentries); -- 2.39.2