Skip to content

Commit

Permalink
fix: getDescendants isEmpty removeLast error
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Nov 7, 2023
1 parent 950b6e6 commit 05ddbb2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/src/main/java/li/songe/gkd/service/AbExt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 05ddbb2

Please sign in to comment.