Skip to content

Commit 915c47f

Browse files
committed
Replace Dictionary with HashSet in SQLite.Connection
1 parent 5e24b59 commit 915c47f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/extensions/IronPython.SQLite/Connection.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public string isolation_level
5858
private List<WeakReference> statements = new List<WeakReference>();
5959
private int created_statements = 0;
6060

61-
private Dictionary<object, object> function_pinboard = new Dictionary<object, object>();
61+
private readonly HashSet<object> function_pinboard = new();
6262

6363
internal Sqlite3.sqlite3 db;
6464

@@ -286,7 +286,7 @@ public void create_function(CodeContext context, string name, int narg, object f
286286
if(rc != Sqlite3.SQLITE_OK)
287287
throw MakeOperationalError("Error creating function");
288288
else
289-
this.function_pinboard[func] = null;
289+
this.function_pinboard.Add(func);
290290
}
291291

292292
private static void callUserFunction(Sqlite3.sqlite3_context ctx, int argc, sqlite3_value[] argv)
@@ -459,7 +459,7 @@ public void create_aggregate(CodeContext context, string name, int n_arg, object
459459
if(rc != Sqlite3.SQLITE_OK)
460460
throw MakeOperationalError("Error creating aggregate");
461461
else
462-
this.function_pinboard[aggregate_class] = null;
462+
this.function_pinboard.Add(aggregate_class);
463463
}
464464

465465
#endregion

0 commit comments

Comments
 (0)