-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
py/objstr: Add new mp_obj_new_str_from_cstr() helper function.
There were lots of places where this pattern was duplicated, to convert a standard C string to a MicroPython string: x = mp_obj_new_str(s, strlen(s)); This commit provides a simpler method that removes this code duplication: x = mp_obj_new_str_from_cstr(s); This gives clearer, and probably smaller, code. Signed-off-by: Jon Foster <[email protected]>
- Loading branch information
Showing
2 changed files
with
5 additions
and
0 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