From 0bef5d4958596135d8ca6e2014cdb3ace98f4aab Mon Sep 17 00:00:00 2001 From: SkiTee3000 <39069192+SkiTee3000@users.noreply.github.com> Date: Fri, 19 Apr 2024 01:47:22 +0300 Subject: [PATCH] Avoid recursion --- src/Database/Sql.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Database/Sql.cs b/src/Database/Sql.cs index 648ad036..36937cf5 100644 --- a/src/Database/Sql.cs +++ b/src/Database/Sql.cs @@ -74,18 +74,17 @@ private void Build() public Sql Append(Sql sql) { - if (_rhs != null) + Sql last = this; + while (last._rhs != null) { - _rhs.Append(sql); - } - else - { - _rhs = sql; + last = last._rhs; } + last._rhs = sql; return this; } + public Sql Append(string sql, params object[] args) { return Append(new Sql(sql, args));