فهرست منبع

Add some explanation to the TopologicalSort method.

BDisp 2 سال پیش
والد
کامیت
3c67eed22d
1فایلهای تغییر یافته به همراه3 افزوده شده و 0 حذف شده
  1. 3 0
      Terminal.Gui/View/View.cs

+ 3 - 0
Terminal.Gui/View/View.cs

@@ -2658,12 +2658,15 @@ namespace Terminal.Gui {
 						}
 						}
 						edges.Remove ((from, to));
 						edges.Remove ((from, to));
 					} else if (from.SuperView == to.SuperView) {
 					} else if (from.SuperView == to.SuperView) {
+						// if 'from' is not yet added to the result, add it
 						if (result.Find (v => v == from) == null) {
 						if (result.Find (v => v == from) == null) {
 							result.Add (from);
 							result.Add (from);
 						}
 						}
+						// if 'to' is not yet added to the result, add it
 						if (result.Find (v => v == to) == null) {
 						if (result.Find (v => v == to) == null) {
 							result.Add (to);
 							result.Add (to);
 						}
 						}
+						// remove from edge
 						edges.Remove ((from, to));
 						edges.Remove ((from, to));
 					} else if (from != superView?.GetTopSuperView (to, from) && !ReferenceEquals (from, to)) {
 					} else if (from != superView?.GetTopSuperView (to, from) && !ReferenceEquals (from, to)) {
 						if (ReferenceEquals (from.SuperView, to)) {
 						if (ReferenceEquals (from.SuperView, to)) {