Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .jules/bolt.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,7 @@
## 2026-08-11 - Comparator 객체 재사용
**학습:** 반복 호출되는 디렉터리 정렬 경계에서 `compareBy<File> { it.name }`를 매번 만들 필요는 없습니다. 정렬 의미가 상태와 무관하면 하나의 불변 비교자를 재사용할 수 있습니다.
**조치:** 파일명 비교자를 최상위 `private val`로 한 번 생성하고 `process_dir`의 정렬에서 재사용합니다. 정렬 순서와 파일 시스템 경계는 변경하지 않습니다.

## 2026-08-11 - 파일명 배열 직접 생성
**학습:** 파일 배열에서 이름 배열을 만들 때 `map(...).toTypedArray()`는 결과 배열 외에 중간 컬렉션도 생성합니다. 호출 경계가 이미 배열을 제공한다면 크기를 알고 있는 결과 배열을 직접 채울 수 있습니다.
**조치:** `crawl_directories`에서 `Array(files.size)`로 파일명 배열을 직접 생성합니다. 순서, null 처리, ignore 입력과 파일 시스템 호출 횟수는 변경하지 않습니다.
4 changes: 3 additions & 1 deletion src/main/kotlin/html4tree/main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ internal fun crawl_directories(
continue
}

val dirFilesNames = dirFiles?.map { it.name }?.toTypedArray()
val dirFilesNames = dirFiles?.let { files ->
Array(files.size) { index -> files[index].name }
}
val exclude = processIgnoreFile(lle.file, dirFilesNames)

if(maxLevel == -1 || currentLevel <= maxLevel)
Expand Down
Loading