background: Clarify the intent of the code

Stomping on local variables and trying to keep loop state isn't
too fun. Just use a new variable here so we aren't too confused
with what we're doing.

https://bugzilla.gnome.org/show_bug.cgi?id=719803
This commit is contained in:
Jasper St. Pierre 2013-12-03 18:08:42 -05:00
parent 887590730d
commit 5262a41619

View File

@ -183,13 +183,16 @@ const BackgroundCache = new Lang.Class({
for (let j = 0; j < pendingLoad.callers.length; j++) { for (let j = 0; j < pendingLoad.callers.length; j++) {
if (pendingLoad.callers[j].onFinished) { if (pendingLoad.callers[j].onFinished) {
if (content && pendingLoad.callers[j].shouldCopy) { let newContent;
content = object.copy(pendingLoad.callers[j].monitorIndex,
pendingLoad.callers[j].effects);
if (content && pendingLoad.callers[j].shouldCopy) {
newContent = content.copy(pendingLoad.callers[j].monitorIndex,
pendingLoad.callers[j].effects);
} else {
newContent = content;
} }
pendingLoad.callers[j].onFinished(content); pendingLoad.callers[j].onFinished(newContent);
} }
} }