diff options
author | Aarni Koskela <akx@iki.fi> | 2024-01-03 22:16:58 +0000 |
---|---|---|
committer | Aarni Koskela <akx@iki.fi> | 2024-01-03 22:26:30 +0000 |
commit | d9034b48a526f0a0c3e8f0dbf7c171bf4f0597fd (patch) | |
tree | b01be238a08893afe6c5e5ebb58715c3860a2299 /modules/ui_gradio_extensions.py | |
parent | e4dcdcc9554d7ff56993f5019eb90fe4ddf1e2e7 (diff) | |
download | stable-diffusion-webui-gfx803-d9034b48a526f0a0c3e8f0dbf7c171bf4f0597fd.tar.gz stable-diffusion-webui-gfx803-d9034b48a526f0a0c3e8f0dbf7c171bf4f0597fd.tar.bz2 stable-diffusion-webui-gfx803-d9034b48a526f0a0c3e8f0dbf7c171bf4f0597fd.zip |
Avoid unnecessary `isfile`/`exists` calls
Diffstat (limited to 'modules/ui_gradio_extensions.py')
-rw-r--r-- | modules/ui_gradio_extensions.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/modules/ui_gradio_extensions.py b/modules/ui_gradio_extensions.py index a86c368e..f5278d22 100644 --- a/modules/ui_gradio_extensions.py +++ b/modules/ui_gradio_extensions.py @@ -35,13 +35,11 @@ def css_html(): return f'<link rel="stylesheet" property="stylesheet" href="{webpath(fn)}">'
for cssfile in scripts.list_files_with_name("style.css"):
- if not os.path.isfile(cssfile):
- continue
-
head += stylesheet(cssfile)
- if os.path.exists(os.path.join(data_path, "user.css")):
- head += stylesheet(os.path.join(data_path, "user.css"))
+ user_css = os.path.join(data_path, "user.css")
+ if os.path.exists(user_css):
+ head += stylesheet(user_css)
return head
|