gitignore 의 *.md / .claude/ 차단을 풀어 다음 파일을 git 으로 추적. - /CLAUDE.md, /AGENTS.md (루트 에이전트 가이드) - .agents/**/*.md (skills 문서 95개) - .claude/settings.json (Claude Code 프로젝트 설정) .claude/worktrees/ 는 git worktree 메타이므로 신규 ignore 라인으로 제외. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
29 lines
532 B
Markdown
29 lines
532 B
Markdown
---
|
||
title: Cache Property Access in Loops
|
||
impact: LOW-MEDIUM
|
||
impactDescription: reduces lookups
|
||
tags: javascript, loops, optimization, caching
|
||
---
|
||
|
||
## Cache Property Access in Loops
|
||
|
||
Cache object property lookups in hot paths.
|
||
|
||
**Incorrect (3 lookups × N iterations):**
|
||
|
||
```typescript
|
||
for (let i = 0; i < arr.length; i++) {
|
||
process(obj.config.settings.value)
|
||
}
|
||
```
|
||
|
||
**Correct (1 lookup total):**
|
||
|
||
```typescript
|
||
const value = obj.config.settings.value
|
||
const len = arr.length
|
||
for (let i = 0; i < len; i++) {
|
||
process(value)
|
||
}
|
||
```
|