- fixed a bug in dnTaverseTree where children would get pushed into the result in reverse order
- added an inode display to the `printTree` algorithm - removed a redundant type in *`signal.ts`* - improved `resolveInode` to now take `ShellState` instead of `FileSystem` and added an optional `abs` *`boolean`* argument to determine if the retuned path should be normalized or absolute - implemented a builtin `TreeNode` quicksort function - changed the `TreeNodeType` to a numeric enum - added a standalone `Posix` class that holds a const with character weights compliant with posix
This commit is contained in:
@@ -14,8 +14,9 @@ export function dnTraverseTree(fs: FileSystem, root: number): number[] {
|
||||
result.push(node.inode);
|
||||
|
||||
if (node.type === TreeNodeType.Directory) {
|
||||
for (const value of Object.values(node.children)) {
|
||||
stack.push(value);
|
||||
const children = Object.values(node.children);
|
||||
for (let i = children.length - 1; i >= 0; i--) {
|
||||
stack.push(children[i] as number);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user