Files
seaweedfs/weed
chrislu bba8931d64 Improve encapsulation: Add shallowClone() method to vidMap
Added a shallowClone() method to vidMap to improve encapsulation and prevent
MasterClient from directly accessing vidMap's internal fields.

Changes:
1. Added vidMap.shallowClone() in vid_map.go
   - Encapsulates the shallow copy logic within vidMap
   - Makes vidMap responsible for its own state representation
   - Documented that caller is responsible for thread safety

2. Simplified resetVidMap() in masterclient.go
   - Uses tail := mc.vidMap.shallowClone() instead of manual field access
   - Cleaner, more maintainable code
   - Better adherence to encapsulation principles

Benefits:
- Improved code organization and maintainability
- vidMap internals are now properly encapsulated
- Easier to modify vidMap structure in the future
- More self-documenting code

Verified with: go test -race ./weed/wdclient/... (passes)
2025-10-30 20:56:13 -07:00
..
2025-10-27 23:04:55 -07:00
2025-10-27 17:33:10 -07:00
2025-10-13 18:05:17 -07:00
2025-08-31 23:31:28 -07:00
2025-10-27 23:04:55 -07:00
2025-10-27 23:04:55 -07:00
2024-06-25 09:18:11 -07:00
2025-08-30 11:15:48 -07:00
2024-02-14 08:26:38 -08:00
2025-10-28 17:57:51 -07:00
2025-10-30 16:43:29 -07:00
2025-10-27 23:04:55 -07:00
2025-07-19 21:43:34 -07:00
2025-03-17 23:13:27 -07:00