Skip to content

Commit 2362d13

Browse files
authored
Switch recursion to iteration Sql Append (#98)
1 parent b926212 commit 2362d13

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/Database/Sql.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,17 @@ private void Build()
7474

7575
public Sql Append(Sql sql)
7676
{
77-
if (_rhs != null)
77+
Sql last = this;
78+
while (last._rhs != null)
7879
{
79-
_rhs.Append(sql);
80-
}
81-
else
82-
{
83-
_rhs = sql;
80+
last = last._rhs;
8481
}
82+
last._rhs = sql;
8583

8684
return this;
8785
}
8886

87+
8988
public Sql Append(string sql, params object[] args)
9089
{
9190
return Append(new Sql(sql, args));

0 commit comments

Comments
 (0)