C#
C#

help

Root Question Message

zonedetec
zonedetec10/27/2022
Performance question

Hello my friends,

Do you think it is more fast to :

1. Check if x key exist in a dictionary
2. Add x key with it's value if it does not already exist

OR

1. try{ Add x key with it's value } catch{}

(because Add x key with it's value will return an error if the key already exist).

Thanks c:
Angius
Angius10/27/2022
.TryAdd()
zonedetec
zonedetec10/27/2022
ohh thankss 🙂
zonedetec
zonedetec10/27/2022
is there any TryRemove() things ?
Message Not Public

Sign In and Join Server To See

10/27/2022
Angius
Angius10/27/2022
Apparently only on ConcurrentDictionary, not Dictionary, for some reason
zonedetec
zonedetec10/27/2022
do you suggest me to use ConcurrentDictionary then ?
zonedetec
zonedetec10/27/2022
for an open source nuget package
Message Not Public

Sign In and Join Server To See

10/27/2022
zonedetec
zonedetec10/27/2022
yeah but it seems to just crash
zonedetec
zonedetec10/27/2022
let me see the error
zonedetec
zonedetec10/27/2022
my bad, u right the error wasn't here.
zonedetec
zonedetec10/27/2022
TryRemove() = Remove()
zonedetec
zonedetec10/27/2022
I just didn't saw it
Message Not Public

Sign In and Join Server To See

10/27/2022
Message Not Public

Sign In and Join Server To See

10/27/2022
ContactFrequently Asked QuestionsJoin The DiscordBugs & Feature RequestsTerms & Privacy