提交 e69d6ce6 编写于 作者: R Rudi Chen

Review: reintroduce count

上级 e48c4a2f
......@@ -361,14 +361,17 @@ export class OutlineModel extends TreeElement {
}
private _compact(): this {
let count = 0;
for (const key in this._groups) {
let group = this._groups[key];
if (first(group.children) === undefined) { // empty
delete this._groups[key];
} else {
count += 1;
}
}
let group = first(this._groups);
if (group) {
if (group && count === 1) {
// adopt all elements of the first group
for (let key in group.children) {
let child = group.children[key];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册