Optimized locks in Cache

main
Inga 🏳‍🌈 15 years ago
parent 6a989f03d5
commit 27e2c61316
  1. 7
      Core/Cache.cs

@ -22,13 +22,12 @@ namespace FLocal.Core {
} }
} }
} }
lock(id) { try {
if(this.cache.ContainsKey(id)) {
return this.cache[id]; return this.cache[id];
} } catch(KeyNotFoundException) {
}
return this.get(id, getter); return this.get(id, getter);
} }
}
public void delete(object id) { public void delete(object id) {
lock(id) { lock(id) {

Loading…
Cancel
Save