kwo pushed a commit to branch master.

http://git.enlightenment.org/legacy/imlib2.git/commit/?id=cd6c00b1ce985df421e2103294e50c997143dbc9

commit cd6c00b1ce985df421e2103294e50c997143dbc9
Author: Kim Woelders <[email protected]>
Date:   Mon Jan 17 11:32:41 2022 +0100

    Avoid redundant operations when non-existing file has no "key"
---
 src/lib/image.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/lib/image.c b/src/lib/image.c
index fb4e82f..1e01471 100644
--- a/src/lib/image.c
+++ b/src/lib/image.c
@@ -492,9 +492,12 @@ __imlib_LoadImage(const char *file, ImlibLoadArgs * ila)
         err = __imlib_FileStat(file, &st);
         if (err)
           {
-             im_file = __imlib_FileRealFile(file);
              im_key = __imlib_FileKey(file);
-             err = __imlib_FileStat(im_file, &st);
+             if (im_key)
+               {
+                  im_file = __imlib_FileRealFile(file);
+                  err = __imlib_FileStat(im_file, &st);
+               }
           }
      }
 

-- 


Reply via email to