Repository navigation
perf(graph): use strings.IndexByte instead of strings.Contains for single char - #694
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
Walkthrough
ChangesWeighted graph key routing
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~3 minutes Change: Refactor Suggested reviewers: Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
🟢 Approval recommended
The replacements are behaviorally equivalent, localized, and covered by existing userset tests.
0 open findings
What changed in this PR
Optimizes single-character checks in the weighted graph without changing behavior.
Changes:
- Replaces
strings.Containswith fasterstrings.IndexBytechecks.
| File | Description |
|---|---|
pkg/go/graph/weighted_graph.go |
Optimizes # detection for node and edge weight lookups. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@saad-h1 lint is failing |
Small performance improvement in weighted graph that @senojj noticed we can make, to use
strings.IndexByteinstead ofstrings.Containswhen checking for a single char.Benchmark: