Skip to content

Commit

Permalink
Android: Improve GameFileCacheManager comments
Browse files Browse the repository at this point in the history
  • Loading branch information
JosJuice committed Mar 16, 2023
1 parent 5a5e055 commit 30e4968
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ public static void startRescan()

public static GameFile addOrGet(String gamePath)
{
// Common case: The game is in the cache, so just grab it from there.
// (Actually, addOrGet already checks for this case, but we want to avoid calling it if possible
// Common case: The game is in the cache, so just grab it from there. (GameFileCache.addOrGet
// actually already checks for this case, but we want to avoid calling it if possible
// because the executor thread may hold a lock on sGameFileCache for extended periods of time.)
GameFile[] allGames = sGameFiles.getValue();
for (GameFile game : allGames)
Expand Down Expand Up @@ -198,6 +198,8 @@ private static void load()

if (sRunRescanAfterLoad)
{
// Without this, there will be a short blip where the loading indicator in the GUI disappears
// because neither sLoadInProgress nor sRescanInProgress is true
sRescanInProgress.postValue(true);
}

Expand Down

0 comments on commit 30e4968

Please sign in to comment.