From 13865cbbc977f033a4c8f14e85bbe8a7c0ecf2e5 Mon Sep 17 00:00:00 2001 From: player-03 Date: Thu, 18 Jan 2024 14:02:58 -0500 Subject: [PATCH] Make better use of `getPath()`. If you check `paths.exists()` first, then there's no benefit to calling `getPath(id)`: it always just returns `paths.get(id)`. It's more effective to let `getPath()` perform all of its checks. --- src/lime/utils/PackedAssetLibrary.hx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lime/utils/PackedAssetLibrary.hx b/src/lime/utils/PackedAssetLibrary.hx index f99b0df82..13161282a 100644 --- a/src/lime/utils/PackedAssetLibrary.hx +++ b/src/lime/utils/PackedAssetLibrary.hx @@ -242,7 +242,8 @@ import flash.media.Sound; else { var basePath = rootPath == null || rootPath == "" ? "" : Path.addTrailingSlash(rootPath); - var libPath = paths.exists(id) ? getPath(id) : id; + var libPath = getPath(id); + if (libPath == null) libPath = id; var path = Path.join([basePath, libPath]); path = __cacheBreak(path);