Add missing UGC maps without early exit#636
Conversation
Previously InitUgcMap returned early if any UgcMap rows existed, preventing new maps from being added later. This change builds a HashSet of existing (MapId, Number) pairs and skips inserts for those pairs, allowing the method to insert only missing map entries while avoiding duplicates. The DefaultHomeMapId check is preserved; AsEnumerable/ToHashSet is used to materialize the existing pairs for comparison.
📝 WalkthroughWalkthroughModified the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. 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 |
Previously InitUgcMap returned early if any UgcMap rows existed, preventing new maps from being added later. This change builds a HashSet of existing (MapId, Number) pairs and skips inserts for those pairs, allowing the method to insert only missing map entries while avoiding duplicates. The DefaultHomeMapId check is preserved; AsEnumerable/ToHashSet is used to materialize the existing pairs for comparison.
Summary by CodeRabbit