fix: use direct map lookup in GetVirtualServerByHeader#1189
fix: use direct map lookup in GetVirtualServerByHeader#1189rogueslasher wants to merge 1 commit into
Conversation
Signed-off-by: rogueslasher <aniketpandey25092005@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesVirtual Server Lookup Optimization
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@Patryk-Stefanski should i file issue (as the new contributing guidelines states )for this since the pr is really a small fix thank you |
What does this PR do?
GetVirtualServerByHeaderwas iterating overm.virtualServerswith a linear scan to find a match byvs.Name, despitem.virtualServersbeing amap[string]*config.VirtualServeralready keyed byvs.Name. This replaces the O(n) loop with a direct O(1) map lookup.Summary by CodeRabbit