From 579b5ce6fb00d87cbba32aeb2e0455991bc7d067 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A2=D0=BE=D0=BF=D1=87=D1=8F=D0=BD=20=D0=9C=D0=B0=D0=BA?= =?UTF-8?q?=D1=81=D0=B8=D0=BC?= <66963865+bubbleStatic@users.noreply.github.com> Date: Wed, 21 Feb 2024 21:11:12 +0300 Subject: [PATCH] Update View.cs string formation is now done with StringBuilder, not String --- Editor/Mono/View.cs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Editor/Mono/View.cs b/Editor/Mono/View.cs index 773b1d019..ff392b469 100644 --- a/Editor/Mono/View.cs +++ b/Editor/Mono/View.cs @@ -26,29 +26,29 @@ internal virtual void Reflow() foreach (View c in children) c.Reflow(); } - internal string DebugHierarchy(int level) { - string prefix = "", s = ""; + StringBuilder prefix = new StringBuilder(); + StringBuilder s = new StringBuilder(); for (int i = 0; i < level; i++) { - prefix = prefix + " "; + prefix.Append(" "); } - s = s + prefix + this + " p:" + position; + s.Append($"{s}{prefix}{this} p:{position}"); if (children.Length > 0) { - s += " {\n"; + s.Append(" {\n"); foreach (View child in children) { - s += child.DebugHierarchy(level + 2); + s.Append(child.DebugHierarchy(level + 2)); } - s += prefix + " }\n"; + s.Append(prefix); + s.Append(" }\n"); } else - s += "\n"; - return s; + s.Append("\n"); + return s.ToString(); } - // Can be used by concrete subclasses to store C++ objects [SerializeField] MonoReloadableIntPtr m_ViewPtr;