summaryrefslogtreecommitdiff
path: root/extmod
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2020-08-04 11:15:22 -0500
committerJeff Epler <jepler@gmail.com>2020-08-04 14:45:45 -0500
commit89797fd3f9d36cd7e2e7a125dbbe02f598874060 (patch)
tree83707505ca82d0847cf0419454956926a8761733 /extmod
parentc37a25f0e5d1c877909855f6a3294e43b854bbbd (diff)
various: Use mp_obj_get_type_qstr more widely
This removes runtime allocations of the cstring version of the qstring. It is not a size improvement
Diffstat (limited to 'extmod')
-rw-r--r--extmod/vfs_fat_file.c2
-rw-r--r--extmod/vfs_posix_file.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/extmod/vfs_fat_file.c b/extmod/vfs_fat_file.c
index 0642f4a9c..89786bfa3 100644
--- a/extmod/vfs_fat_file.c
+++ b/extmod/vfs_fat_file.c
@@ -42,7 +42,7 @@ const byte fresult_to_errno_table[20] = {
STATIC void file_obj_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) {
(void)kind;
- mp_printf(print, "<io.%s %p>", mp_obj_get_type_str(self_in), MP_OBJ_TO_PTR(self_in));
+ mp_printf(print, "<io.%q %p>", mp_obj_get_type_qstr(self_in), MP_OBJ_TO_PTR(self_in));
}
STATIC mp_uint_t file_obj_read(mp_obj_t self_in, void *buf, mp_uint_t size, int *errcode) {
diff --git a/extmod/vfs_posix_file.c b/extmod/vfs_posix_file.c
index eefc1d905..3f887785e 100644
--- a/extmod/vfs_posix_file.c
+++ b/extmod/vfs_posix_file.c
@@ -34,7 +34,7 @@ STATIC void check_fd_is_open(const mp_obj_vfs_posix_file_t *o) {
STATIC void vfs_posix_file_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) {
(void)kind;
mp_obj_vfs_posix_file_t *self = MP_OBJ_TO_PTR(self_in);
- mp_printf(print, "<io.%s %d>", mp_obj_get_type_str(self_in), self->fd);
+ mp_printf(print, "<io.%q %d>", mp_obj_get_type_qstr(self_in), self->fd);
}
mp_obj_t mp_vfs_posix_file_open(const mp_obj_type_t *type, mp_obj_t file_in, mp_obj_t mode_in) {