Skip to content

Commit

Permalink
Make better use of getPath().
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
player-03 authored Jan 18, 2024
1 parent 558fd07 commit 13865cb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lime/utils/PackedAssetLibrary.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 13865cb

Please sign in to comment.