-
-
Notifications
You must be signed in to change notification settings - Fork 647
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve: change from memset/memcpy to modern cpp ranges (#2989)
This refactors several parts of the codebase to modernize it by replacing C-style memory operations (`memset`, `memcpy`) with safer and more expressive C++ standard library features such as `std::fill`, `std::copy`, and `std::ranges::copy`. These changes improve code readability, maintainability, and safety by leveraging C++ best practices. Specifically, the following areas were improved: • Replaced `memcpy` with `std::ranges::copy` to handle buffer copying more safely. • Replaced `memset` with `std::fill` to initialize memory with zeros in a type-safe manner. • Replaced C-style array manipulations with `std::array` and modern C++ iterators to avoid unsafe pointer arithmetic.
- Loading branch information
Showing
5 changed files
with
99 additions
and
78 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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