mirror of
https://github.com/gkd-kit/gkd.git
synced 2024-11-16 03:32:38 +08:00
fix: getDescendants isEmpty removeLast error
This commit is contained in:
parent
950b6e6b4b
commit
05ddbb23ce
|
@ -149,6 +149,7 @@ val abTransform = Transform(
|
|||
getDescendants = { node ->
|
||||
sequence {
|
||||
val stack = getChildren(node).toMutableList()
|
||||
if (stack.isEmpty()) return@sequence
|
||||
val tempNodes = mutableListOf<AccessibilityNodeInfo>()
|
||||
do {
|
||||
val top = stack.removeLast()
|
||||
|
|
|
@ -53,6 +53,7 @@ class Transform<T>(
|
|||
sequence { // 深度优先 先序遍历
|
||||
// https://developer.mozilla.org/zh-CN/docs/Web/API/Document/querySelector
|
||||
val stack = getChildren(node).toMutableList()
|
||||
if (stack.isEmpty()) return@sequence
|
||||
stack.reverse()
|
||||
val tempNodes = mutableListOf<T>()
|
||||
do {
|
||||
|
|
Loading…
Reference in New Issue
Block a user