Merged
Conversation
c475d95 to
2e8b49f
Compare
8b58657 to
a91c5b6
Compare
Owner
Author
|
All tests and benchmarks pass with commit a91c5b6 in
|
a91c5b6 to
6d146da
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR introduces functions to normalize file path separators and updates both the implementation and tests accordingly.
- Added new functions IsPathNormalized and NormailizePathSeparatorsInPlace in FileUtils.h and implemented them in FileUtils.c.
- Updated main.c to utilize the new normalization function when processing input paths.
- Expanded the test suite in TestFileUtils.c to cover both normalized and unnormalized path cases.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| CoDeLib/include/CoDeLib/FileUtils/FileUtils.h | Added declarations for path normalization functions. |
| CoDeLib/FileUtils/src/FileUtils.c | Implemented the normalization functions and integrated them into other APIs. |
| CoDeLib/Test/src/main.c | Updated usage of path normalization for processing input paths. |
| CoDeLib/Test/src/TestFileUtils.c | Added test cases to validate path normalization behavior. |
Comments suppressed due to low confidence (1)
CoDeLib/include/CoDeLib/FileUtils/FileUtils.h:28
- Consider renaming 'NormailizePathSeparatorsInPlace' to 'NormalizePathSeparatorsInPlace' to correct the spelling and improve clarity.
char *NormailizePathSeparatorsInPlace(char *pPath);
| return false; | ||
| } | ||
|
|
||
| for (size_t i = 0; i < strlen(pPath); ++i) { |
There was a problem hiding this comment.
Store the result of strlen(pPath) in a local variable before the loop to avoid multiple calls during iteration.
Suggested change
| for (size_t i = 0; i < strlen(pPath); ++i) { | |
| size_t pathLength = strlen(pPath); | |
| for (size_t i = 0; i < pathLength; ++i) { |
| return NULL; | ||
| } | ||
|
|
||
| for (size_t i = 0; i < strlen(pPath); ++i) { |
There was a problem hiding this comment.
Storing the length of pPath in a variable before iterating can improve performance by preventing repeated calls to strlen.
Suggested change
| for (size_t i = 0; i < strlen(pPath); ++i) { | |
| size_t pathLength = strlen(pPath); | |
| for (size_t i = 0; i < pathLength; ++i) { |
Owner
Author
|
Tests and benchmark from 6d146da also pass on the Zybo. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.