Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 2ad7e56

Browse files
author
Marcio Althmann
committed
Clean commented code and a tiny optimization to return false if the value is null.
1 parent 9300fd0 commit 2ad7e56

File tree

1 file changed

+7
-13
lines changed
  • src/ServiceStack.OrmLite/Expressions

1 file changed

+7
-13
lines changed

src/ServiceStack.OrmLite/Expressions/Sql.cs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,17 @@ namespace ServiceStack.OrmLite
66
{
77
public static class Sql
88
{
9-
//public static bool In<T>(T value, IList<Object> list)
10-
//{
11-
// foreach (Object obj in list)
12-
// {
13-
// if (obj == null || value == null) continue;
14-
// if (obj.ToString() == value.ToString()) return true;
15-
// }
16-
// return false;
17-
//}
18-
199
public static bool In<T>(T value, params object[] list)
20-
{
10+
{
11+
if(value == null)
12+
return false;
13+
2114
foreach (var obj in list)
2215
{
23-
if (obj == null || value == null) continue;
16+
if (obj == null) continue;
2417
if (obj.ToString() == value.ToString()) return true;
25-
}
18+
}
19+
2620
return false;
2721
}
2822

0 commit comments

Comments
 (0)