- Joined
- May 17, 2007
- Messages
- 2,468
- Reaction score
- 681
Hi
Been looking for an alternative for storing temporary data, things that will only be used for a matter of time, then never used again etc. A method I've been looking for for a while is the Dictionary collection type. But reading that it's slow when getting indexes etc, i cannot make up my mind if i should just stick to normal variables, or go to collection storage.
Field:
Adding data:
use:
etc etc
instead of:
Good idea?
Been looking for an alternative for storing temporary data, things that will only be used for a matter of time, then never used again etc. A method I've been looking for for a while is the Dictionary collection type. But reading that it's slow when getting indexes etc, i cannot make up my mind if i should just stick to normal variables, or go to collection storage.
Field:
Code:
public Dictionary<string, object> TemporaryAttributes = new Dictionary<string, object>();
Adding data:
Code:
TemporaryAttributes.Add("LOGIN_STAGE", 0);
use:
Code:
If (TemporaryAttributes["LOGIN_STAGE"] == 0) return;
If (TemporaryAttributes["LOGIN_STAGE"] == 1) //do some shiet//
TemporaryAttributes.Remove("LOGIN_STAGE");
instead of:
Code:
int loginStage = 0;
...
if (loginStage == 0) return;
if (loginStage == 1) //do some shiet here//
Good idea?