You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: implement __eq__ and __ne__ for CopyOnWriteDict (#55)
* fix: implement __eq__ and __ne__ for CopyOnWriteDict
Fixes equality comparison bug where CopyOnWriteDict compared equal to {}
even when containing data. This caused apply_policy() to incorrectly drop
valid payload modifications when plugins removed all arguments.
Changes:
- Add __eq__ and __ne__ methods to CopyOnWriteDict
- Add 13 comprehensive equality unit tests
- Add policy regression tests for empty args scenario
- Add end-to-end integration tests
Signed-off-by: prakhar-singh1928 <prakhar.singh1928@ibm.com>
* fix: added length check for performance
Signed-off-by: prakhar-singh1928 <prakhar.singh1928@ibm.com>
* fix: restore deleted assertion and add performance optimization
- Restored missing 'assert a not in keys' in test_iteration_order_with_deletions
- Added fast-path length check in CopyOnWriteDict.__eq__() for better performance
- Performance optimization is safe: if lengths differ, mappings cannot be equal
Signed-off-by: prakhar-singh1928 <prakhar.singh1928@ibm.com>
* fix: linted memory.py, added assertion to test.
---------
Signed-off-by: prakhar-singh1928 <prakhar.singh1928@ibm.com>
Co-authored-by: Teryl Taylor <teryl.taylor@gmail.com>
0 commit comments