Skip to content
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

Minor optimisation to ATCmdParser unit test code #12291

Merged
merged 1 commit into from Jan 23, 2020

Conversation

DavidLin1577
Copy link
Contributor

@DavidLin1577 DavidLin1577 commented Jan 21, 2020

Summary of changes

This is a minor optimisation to the unit test code:

  1. The first buf initialisation was missing (although not required by the test code)
  2. The second buf is zero initialised instead of using memset. The code is more readable and portable.

Impact of changes

Migration actions required

Documentation


Pull request type

[*] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[*] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers


1. replace  'char buf[8];    memset(buf, 0, 8);' with 'char buf[8] = {0};'.
@ciarmcom ciarmcom requested review from a team January 21, 2020 14:00
@ciarmcom
Copy link
Member

@DavidLin1577, thank you for your changes.
@ARMmbed/mbed-os-core @ARMmbed/mbed-os-maintainers please review.

@bulislaw bulislaw requested a review from a team January 21, 2020 16:13
Copy link
Contributor

@evedon evedon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your change.

The first buf initialisation is not required but does not harm.
The second initialisation is required by the test. Although the memset implementation was fine, it is better to zero initialise the array. (There was a recent change to increase buf size and memset had to be modified as well).

Could you update :

@DavidLin1577
Copy link
Contributor Author

Thanks so much for evedon:
As you advise, I had readed the guidelines, and updated the comment, thank you.

@evedon evedon changed the title optimize the code of array set to zero Minor optimisation to ATCmdParser unit test code Jan 22, 2020
@evedon
Copy link
Contributor

evedon commented Jan 22, 2020

@DavidLin1577 Re-worded the title and PR description for readability. PR approved.

@adbridge
Copy link
Contributor

CI started

@mbed-ci
Copy link

mbed-ci commented Jan 22, 2020

Test run: SUCCESS

Summary: 1 of 1 test jobs passed
Build number : 1
Build artifacts

@adbridge adbridge merged commit 159a57b into ARMmbed:master Jan 23, 2020
@adbridge adbridge added release-version: 6.0.0-alpha-2 Second pre-release version of 6.0.0 and removed ready for merge labels Jan 23, 2020
@mergify
Copy link

mergify bot commented Jan 23, 2020

This PR does not contain release version label after merging.

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 3, 2020

It looks like we shall first mark the version the merge. Timing here might be involved. As I tested this on another PR that I marked version first then merged, no release review required. This was done other way around. Anyway, will report this to mergify

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-version: 6.0.0-alpha-2 Second pre-release version of 6.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants