-
Notifications
You must be signed in to change notification settings - Fork 16
use deepcopy in set_message_fields for safety. #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
# Create a deep copy of the input dictionary to avoid modifying it for safety | ||
values = copy.deepcopy(values) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this function handles the nested structure internally, i would use deepcopy
for the safety.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this have any sort of performance impact?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
of course it does. but i think this is not performance sensitive API. (besides python...)
assert arrays_msg.basic_types_values[2].uint8_value == 0 | ||
|
||
|
||
def test_set_nested_namespaced_fields_with_same_values(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test fails with out this PR.
@esteve been a while, can you take a look at this minor fix when you have time? thanks in advance. |
Pulls: #34 |
RHEL test failure is a known flake. LGTM. |
closes #33