Skip to content

Commit 6f7337c

Browse files
committed
CSHARP-5779: Removed a small amount of unused code
1 parent 02f691a commit 6f7337c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/MongoDB.Driver/Linq/Linq3Implementation/Translators/ExpressionToAggregationExpressionTranslators/MemberExpressionToAggregationExpressionTranslator.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ private static bool TryTranslateDictionaryProperty(TranslationContext context, M
216216
case "Keys":
217217
var keysAst = dictionaryRepresentation switch
218218
{
219-
DictionaryRepresentation.Document or DictionaryRepresentation.ArrayOfDocuments => AstExpression.Map(containerAst, kvpVar, AstExpression.GetField(kvpVar, "k")),
219+
DictionaryRepresentation.ArrayOfDocuments => AstExpression.Map(containerAst, kvpVar, AstExpression.GetField(kvpVar, "k")),
220220
DictionaryRepresentation.ArrayOfArrays => AstExpression.Map(containerAst, kvpVar, AstExpression.ArrayElemAt(kvpVar, 0)),
221221
_ => throw new ExpressionNotSupportedException(expression, $"Unexpected dictionary representation: {dictionaryRepresentation}")
222222
};
@@ -231,7 +231,7 @@ private static bool TryTranslateDictionaryProperty(TranslationContext context, M
231231
{
232232
var kvpPairsAst = dictionaryRepresentation switch
233233
{
234-
DictionaryRepresentation.Document or DictionaryRepresentation.ArrayOfDocuments => containerAst,
234+
DictionaryRepresentation.ArrayOfDocuments => containerAst,
235235
DictionaryRepresentation.ArrayOfArrays => AstExpression.Map(containerAst, kvpVar, AstExpression.ComputedDocument([("k", AstExpression.ArrayElemAt(kvpVar, 0)), ("v", AstExpression.ArrayElemAt(kvpVar, 1))])),
236236
_ => throw new ExpressionNotSupportedException(expression, $"Unexpected dictionary representation: {dictionaryRepresentation}")
237237
};
@@ -243,7 +243,6 @@ private static bool TryTranslateDictionaryProperty(TranslationContext context, M
243243
{
244244
var valuesAst = dictionaryRepresentation switch
245245
{
246-
DictionaryRepresentation.Document => AstExpression.Map(AstExpression.ObjectToArray(containerAst), kvpVar, AstExpression.GetField(kvpVar, "v")),
247246
DictionaryRepresentation.ArrayOfArrays => AstExpression.Map(containerAst, kvpVar, AstComputedArrayExpression.ArrayElemAt(kvpVar, 1)),
248247
DictionaryRepresentation.ArrayOfDocuments => AstExpression.Map(containerAst, kvpVar, AstExpression.GetField(kvpVar, "v")),
249248
_ => throw new ExpressionNotSupportedException(expression, $"Unexpected dictionary representation: {dictionaryRepresentation}")

0 commit comments

Comments
 (0)