@@ -89,7 +89,7 @@ func (self *Node[T]) SortChildren() {
89
89
return 1
90
90
}
91
91
92
- return strings .Compare (a .GetPath () , b .GetPath () )
92
+ return strings .Compare (a .Path , b .Path )
93
93
})
94
94
95
95
// TODO: think about making this in-place
@@ -159,7 +159,7 @@ func (self *Node[T]) EveryFile(test func(*T) bool) bool {
159
159
func (self * Node [T ]) Flatten (collapsedPaths * CollapsedPaths ) []* Node [T ] {
160
160
result := []* Node [T ]{self }
161
161
162
- if len (self .Children ) > 0 && ! collapsedPaths .IsCollapsed (self .GetPath () ) {
162
+ if len (self .Children ) > 0 && ! collapsedPaths .IsCollapsed (self .Path ) {
163
163
result = append (result , lo .FlatMap (self .Children , func (child * Node [T ], _ int ) []* Node [T ] {
164
164
return child .Flatten (collapsedPaths )
165
165
})... )
@@ -185,7 +185,7 @@ func (self *Node[T]) getNodeAtIndexAux(index int, collapsedPaths *CollapsedPaths
185
185
return self , offset
186
186
}
187
187
188
- if ! collapsedPaths .IsCollapsed (self .GetPath () ) {
188
+ if ! collapsedPaths .IsCollapsed (self .Path ) {
189
189
for _ , child := range self .Children {
190
190
foundNode , offsetChange := child .getNodeAtIndexAux (index - offset , collapsedPaths )
191
191
offset += offsetChange
@@ -201,11 +201,11 @@ func (self *Node[T]) getNodeAtIndexAux(index int, collapsedPaths *CollapsedPaths
201
201
func (self * Node [T ]) GetIndexForPath (path string , collapsedPaths * CollapsedPaths ) (int , bool ) {
202
202
offset := 0
203
203
204
- if self .GetPath () == path {
204
+ if self .Path == path {
205
205
return offset , true
206
206
}
207
207
208
- if ! collapsedPaths .IsCollapsed (self .GetPath () ) {
208
+ if ! collapsedPaths .IsCollapsed (self .Path ) {
209
209
for _ , child := range self .Children {
210
210
offsetChange , found := child .GetIndexForPath (path , collapsedPaths )
211
211
offset += offsetChange + 1
@@ -225,7 +225,7 @@ func (self *Node[T]) Size(collapsedPaths *CollapsedPaths) int {
225
225
226
226
output := 1
227
227
228
- if ! collapsedPaths .IsCollapsed (self .GetPath () ) {
228
+ if ! collapsedPaths .IsCollapsed (self .Path ) {
229
229
for _ , child := range self .Children {
230
230
output += child .Size (collapsedPaths )
231
231
}
0 commit comments