Daniel Viegas 3652246bd4 Major code improvements: performance, maintainability, and cleanup
Performance optimizations:
- Optimized event-to-person lookup from O(n*m) to O(n+m) using reverse index
- Added _build_event_to_person_index() to build cache once during event collection
- Improved collision detection algorithm efficiency

Code quality improvements:
- Removed duplicate logger definition
- Removed redundant checks in _calculate_max_connection_line_x()
- Removed unused wrapper method detect_label_overlaps()
- Removed 3 unused methods: _collect_person_events, _collect_person_event_refs, _process_event_ref (67 lines of dead code)

Code organization:
- Extracted helper methods to reduce duplication:
  * _get_person_display_name() for person name lookups
  * _create_timeline_event() for TimelineEvent creation
  * _copy_timeline_event_with_y_pos() for TimelineEvent copying
- Reduced code duplication in filter dialog with nested helper function
- Extracted magic numbers to constants (color values, spacing)

Maintainability:
- Better separation of concerns with helper methods
- Improved code organization and readability
- Consistent error handling patterns
- Fixed indentation issue in _get_person_color()

All changes are backward compatible and maintain existing functionality.
2025-11-29 22:32:56 +01:00
Description
MyTimeline Gramps plugin
822 KiB
Languages
Python 94.2%
Shell 5.8%