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

ucm: Code simplification and fixes #11

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

crojewsk
Copy link
Member

@crojewsk crojewsk commented May 8, 2023

A range of fixes aiming to improve code quality.

It starts with removal of unused ctors for the abstract classes - unused and not intended to be used by inheriting classes. While most of remaining patches are pretty self explanatory, the largest change rewrites FormatsString and RatesString property. Goal is to remove any ambiguity by improving string-parsing mechanism and dropping empty entries before doing so.

crojewsk added 7 commits May 2, 2023 16:37
Default constructors for abstract classes are not referenced anywhere.

Signed-off-by: Cezary Rojewski <[email protected]>
First, handle case where value provided is null to avoid
ArgumentNullException.

Second, be more thorough when splitting string-representation of
constants into separate entries. That is, trim and remove empty entries.

Last, while '_' is part of PCM_RATE constants names, do not allow for
ambiguity and treat rate-strings such as "_192000" as invalid.

Signed-off-by: Cezary Rojewski <[email protected]>
No need for else-if-statements if the preceding if-statement ends with
return.

Signed-off-by: Cezary Rojewski <[email protected]>
While abstract classes cannot be instantiated, for consistency
streamline TokenType value returned for the base Section-type.

Signed-off-by: Cezary Rojewski <[email protected]>
TypeDescriptor::GetConverter() either returns non-null value or throws
an exception so remove the existing null-check.

Signed-off-by: Cezary Rojewski <[email protected]>
Improves readability.

Signed-off-by: Cezary Rojewski <[email protected]>
Throw null-exception when invalid stream is specified.

Signed-off-by: Cezary Rojewski <[email protected]>
Copy link
Collaborator

@amadeuszslawinski-intel amadeuszslawinski-intel left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants