-
Notifications
You must be signed in to change notification settings - Fork 0
⚡ Bolt: unique non-NA 값 계산 시 불필요한 stats::na.omit 오버헤드 제거 #293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -770,8 +770,8 @@ autoFIPC <- | |
| if ( | ||
| !is.na(newFormItemName) && | ||
| !is.na(oldFormItemName) && | ||
| (length(stats::na.omit(unique(newFormModel@Data$data[, newFormItemName]))) == | ||
| length(stats::na.omit(unique(oldFormModel@Data$data[, oldFormItemName])))) | ||
| (sum(!is.na(unique(newFormModel@Data$data[, newFormItemName]))) == | ||
| sum(!is.na(unique(oldFormModel@Data$data[, oldFormItemName])))) | ||
|
Comment on lines
+773
to
+774
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 Info: na.omit rewrite preserves distinct-count semantics
Was this helpful? React with 👍 or 👎 to provide feedback. |
||
| ) { | ||
| message( | ||
| 'applying ', | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
복잡도 설명을 O(1)로 기록하지 마세요.
unique(x)는 입력 전체를 검사해야 합니다.is.na()와sum()도 결과를 순회합니다. 전체 계산은 O(1)이 아닙니다.stats::na.omit()의 method dispatch와na.action속성 할당을 줄여 상수 비용을 개선한다고 설명하세요.🤖 Prompt for AI Agents