Skip to content

Commit f65d1a0

Browse files
committed
main: Drop "double extension" detection if not FULL_BUILD
This saves nearly 200 bytes. Curiously, it also saves RAM.
1 parent 0517c3e commit f65d1a0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,20 +257,24 @@ bool run_code_py(safe_mode_t safe_mode) {
257257
new_status_color(MAIN_RUNNING);
258258

259259
static const char *supported_filenames[] = STRING_LIST("code.txt", "code.py", "main.py", "main.txt");
260+
#if CIRCUITPY_FULL_BUILD
260261
static const char *double_extension_filenames[] = STRING_LIST("code.txt.py", "code.py.txt", "code.txt.txt","code.py.py",
261262
"main.txt.py", "main.py.txt", "main.txt.txt","main.py.py");
263+
#endif
262264

263265
stack_resize();
264266
filesystem_flush();
265267
supervisor_allocation* heap = allocate_remaining_memory();
266268
start_mp(heap);
267269
found_main = maybe_run_list(supported_filenames, &result);
270+
#if CIRCUITPY_FULL_BUILD
268271
if (!found_main){
269272
found_main = maybe_run_list(double_extension_filenames, &result);
270273
if (found_main) {
271274
serial_write_compressed(translate("WARNING: Your code filename has two extensions\n"));
272275
}
273276
}
277+
#endif
274278
cleanup_after_vm(heap);
275279

276280
if (result.return_code & PYEXEC_FORCED_EXIT) {

0 commit comments

Comments
 (0)