]> git.xonotic.org Git - xonotic/darkplaces.git/commit
Fix bug in stringbuffers with bufstr_set not updating num_strings; add a new builtin...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 19 Jan 2008 01:46:58 +0000 (01:46 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 19 Jan 2008 01:46:58 +0000 (01:46 +0000)
commit35c8cfbd72a28c118ad95791ccff57bb8916d4d5
treefdc58b6e42f641ca2aa727ab2041773068d64c53
parent75cf0e1d6003d6a21d1d6e0e9273a2482b86c75d
Fix bug in stringbuffers with bufstr_set not updating num_strings; add a new builtin for QC called float hash(float caseinsensitive, string str) that returns the CRC of the string (possibly after lowercasing). Using this, a persistent database can be implemented quite efficiently (for a 1MB database file, it takes about 0.1 seconds to load and 0.3 seconds to save, which is quite acceptable). From QC, I use a string buffer of 16384 strings, indexed by hash of the key, containing an info string at each index to solve the collision issue. Possibly add hash() to the stringbuffer DP extension, or make a new extension for it?

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7979 d7cf8633-e32d-0410-b094-e92efae38249
prvm_cmds.c
prvm_cmds.h
svvm_cmds.c