diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2018-08-05 23:56:19 +0300 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2018-10-22 22:49:05 +1100 |
commit | 5a91fce9f868eeba37a0b1cf6c3b4435ed5eecec (patch) | |
tree | a81202c0b0a5d6d68790ea0a42fdb1ee395f6794 /py/objstrunicode.c | |
parent | 7795b2e5c3e3dfeb20aaca751c45b4dfceedcc7f (diff) |
py/objstr: Make str.count() method configurable.
Configurable via MICROPY_PY_BUILTINS_STR_COUNT. Default is enabled.
Disabled for bare-arm, minimal, unix-minimal and zephyr ports. Disabling
it saves 408 bytes on x86.
Diffstat (limited to 'py/objstrunicode.c')
-rw-r--r-- | py/objstrunicode.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/py/objstrunicode.c b/py/objstrunicode.c index badb569d7..13da922a8 100644 --- a/py/objstrunicode.c +++ b/py/objstrunicode.c @@ -243,7 +243,9 @@ STATIC const mp_rom_map_elem_t struni_locals_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_rstrip), MP_ROM_PTR(&str_rstrip_obj) }, { MP_ROM_QSTR(MP_QSTR_format), MP_ROM_PTR(&str_format_obj) }, { MP_ROM_QSTR(MP_QSTR_replace), MP_ROM_PTR(&str_replace_obj) }, + #if MICROPY_PY_BUILTINS_STR_COUNT { MP_ROM_QSTR(MP_QSTR_count), MP_ROM_PTR(&str_count_obj) }, + #endif #if MICROPY_PY_BUILTINS_STR_PARTITION { MP_ROM_QSTR(MP_QSTR_partition), MP_ROM_PTR(&str_partition_obj) }, { MP_ROM_QSTR(MP_QSTR_rpartition), MP_ROM_PTR(&str_rpartition_obj) }, |