Micro-optimization

This commit is contained in:
Kovid Goyal 2021-05-16 08:55:08 +05:30
parent d0c34d2131
commit dcc0818e81
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -13,10 +13,9 @@ autoreload_enabled = False
AUTO_UPDATE_THRESHOLD = 1000 # millisecs AUTO_UPDATE_THRESHOLD = 1000 # millisecs
def iframe_main(): def iframe_main(script):
script = document.getElementById('bootstrap') script.parentNode.removeChild(script) # free up some memory
if script: script = undefined
script.parentNode.removeChild(script) # free up some memory
m = ρσ_get_module(window.iframe_entry_point) m = ρσ_get_module(window.iframe_entry_point)
main = m?.main main = m?.main
if main: if main:
@ -56,6 +55,6 @@ def toplevel_main():
if document?: if document?:
iframe_script = document.getElementById('bootstrap') iframe_script = document.getElementById('bootstrap')
if iframe_script: if iframe_script:
iframe_main() iframe_main(iframe_script)
else: else:
toplevel_main() toplevel_main()