Skip to content

Commit

Permalink
don't rely on tryadd for scalar check
Browse files Browse the repository at this point in the history
  • Loading branch information
Quin Lynch committed Apr 22, 2024
1 parent c728790 commit b34429c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/EdgeDB.Net.QueryBuilder/Utils/EdgeDBTypeUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,10 @@ public static bool TryGetScalarType(Type type, [MaybeNullWhen(false)] out EdgeDB
else if (type.IsEnum)
info = new(type, type.GetEdgeDBTypeName(), false, child);

if(info is not null)
_typeCache.TryAdd(type, info);

return info != null && _typeCache.TryAdd(type, info);
return info != null;
}

/// <summary>
Expand Down

0 comments on commit b34429c

Please sign in to comment.