Skip to content

UPSTREAM PR #16708: Fix confusing double negation with empty else if#119

Open
loci-dev wants to merge 3 commits into
mainfrom
loci/pr-16708-else-if-negation
Open

UPSTREAM PR #16708: Fix confusing double negation with empty else if#119
loci-dev wants to merge 3 commits into
mainfrom
loci/pr-16708-else-if-negation

Conversation

@loci-dev

Copy link
Copy Markdown

Note

Source pull request: nushell/nushell#16708

This else if branch being empty makes no sense if there is no comment.
Can be collapsed by removing the negation on the matches!

Stumbled over this while reading nushell/nushell#16688 (comment)

Release notes summary - What our users need to know

N/A

Tasks after submitting

This `else if` branch being empty makes no sense if there is no comment.
Can be collapsed by removing the negation on the `matches!`

Stumbled over this while reading nushell/nushell#16688 (comment)
@loci-review

loci-review Bot commented Mar 15, 2026

Copy link
Copy Markdown

Overview

Analysis of 29,125 functions shows negligible performance impact with 0.006% power consumption reduction. The 3 commits refactor conditional expressions to eliminate confusing double negations—a code quality improvement with no performance regressions.

Function counts: 97 modified, 129 new, 129 removed, 28,770 unchanged

Binary: target.aarch64-unknown-linux-gnu.release.nu

  • Power consumption: 795,579 nJ → 795,532 nJ (-0.006%)

Function Analysis

std::sys::fs::read_dir (Rust standard library): Response time improved 21.8% (551ns → 431ns). Self-time reduced 46% through compiler optimizations (memory fence insertion, improved code layout). Used extensively in ls, completions, and directory operations—120ns improvement per call compounds in directory-heavy workloads.

nu_plugin_engine::interface::PluginInterfaceManager::send_engine_call::: Response time improved 13.4% (791ns → 685ns). Compiler eliminated logging overhead (105ns) from error path. No source code changes; optimization from release build configuration.

SQLite functions (sqlite3FkOldmask, appendOnePathElement): Minor regressions of 1.1% and 0.08% respectively (+21ns each) from stack canary consolidation. Non-critical paths in history database operations—absolute impact negligible for I/O-bound operations.

No changes to performance-critical areas (IR execution, pipeline data flow, parser, REPL loop).

🔎 Full breakdown: Loci Inspector
💬 Questions? Tag @loci-dev

@loci-dev loci-dev force-pushed the main branch 3 times, most recently from d6c3b3e to aa2e4e6 Compare March 18, 2026 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants