summaryrefslogtreecommitdiff
path: root/src/idManager.c
diff options
context:
space:
mode:
authororoborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-06-20 20:16:44 +0000
committeroroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-06-20 20:16:44 +0000
commit7af32f143eb8615163e1bc78a417434e18da0e71 (patch)
tree815f50fe8d0a5f1296436509d5d9f7b9bd7be094 /src/idManager.c
parenta370d2f5860a0f89ac44af857d1059885ad1d60f (diff)
- oprava chyb s pamatov
- vyhladavanie objetku podla jeho ID ma konecne casovu narocnost log(2,n) git-svn-id: http://opensvn.csie.org/tuxanci_ng@67 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src/idManager.c')
-rw-r--r--src/idManager.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/idManager.c b/src/idManager.c
index 3162771..ea7e679 100644
--- a/src/idManager.c
+++ b/src/idManager.c
@@ -45,13 +45,15 @@ int getNewID()
assert( listID != NULL );
do{
+ ret = random() % MAX_ID;
+/*
ret = ++lastID;
if( lastID > MAX_ID )
{
lastID = 0;
}
-
+*/
}while( isRegisterID(ret) != -1 );
addList(listID, newInt(ret) );