Skip to content

Commit 0c8e3b3

Browse files
committed
CSHARP-1650: Combine if statements.
1 parent 29fdc76 commit 0c8e3b3

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/MongoDB.Driver/Linq/Translators/AggregateLanguageTranslator.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@ private bool TryTranslateStringMethodCall(MethodCallExpression node, out BsonVal
977977
}
978978
break;
979979
case "Split":
980-
if (node.Arguments.Count < 1)
980+
if (node.Arguments.Count < 1 || node.Arguments.Count > 2)
981981
{
982982
return false;
983983
}
@@ -1008,10 +1008,6 @@ private bool TryTranslateStringMethodCall(MethodCallExpression node, out BsonVal
10081008
return false;
10091009
}
10101010
}
1011-
if (node.Arguments.Count > 2)
1012-
{
1013-
return false;
1014-
}
10151011
result = new BsonDocument("$split", new BsonArray
10161012
{
10171013
field,

0 commit comments

Comments
 (0)