Skip to content

Commit

Permalink
reordered condition
Browse files Browse the repository at this point in the history
  • Loading branch information
WhatzGames committed Apr 2, 2024
1 parent fc4e3bb commit 0a2debd
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,32 +134,32 @@ public NpgsqlRegexTranslator(

var translatedOptions = TranslateOptions(options);

if (translatedOptions.Length > 0)
if (translatedOptions.Length is 0)
{
return _sqlExpressionFactory.Function(
"regexp_replace",
return _sqlExpressionFactory.Function("regexp_replace",
new[]
{
_sqlExpressionFactory.ApplyTypeMapping(input, typeMapping),
_sqlExpressionFactory.ApplyTypeMapping(pattern, typeMapping),
_sqlExpressionFactory.ApplyTypeMapping(replacement, typeMapping),
_sqlExpressionFactory.Constant(translatedOptions)
_sqlExpressionFactory.ApplyTypeMapping(replacement, typeMapping)
},
nullable: true,
new[] { true, true, true, true },
new[] { true, true, true},
typeof(string),
_typeMappingSource.FindMapping(typeof(string)));
}

return _sqlExpressionFactory.Function("regexp_replace",
return _sqlExpressionFactory.Function(
"regexp_replace",
new[]
{
_sqlExpressionFactory.ApplyTypeMapping(input, typeMapping),
_sqlExpressionFactory.ApplyTypeMapping(pattern, typeMapping),
_sqlExpressionFactory.ApplyTypeMapping(replacement, typeMapping)
_sqlExpressionFactory.ApplyTypeMapping(replacement, typeMapping),
_sqlExpressionFactory.Constant(translatedOptions)
},
nullable: true,
new[] { true, true, true},
new[] { true, true, true, true },
typeof(string),
_typeMappingSource.FindMapping(typeof(string)));
}
Expand Down

0 comments on commit 0a2debd

Please sign in to comment.