Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit c4d95c7

Browse files
committed
Used local var to prevent getCaller() from being computed twice
1 parent 562726d commit c4d95c7

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Toolset/palettes/script editor/behaviors/revsefindmaincardbehavior.livecodescript

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ end menuPick
3333

3434
on closeCard
3535
historySave
36-
if there is a stack getCaller() then
37-
send "revSEFindFinalize" to (getCaller())
36+
local tCaller
37+
put getCaller() into tCaller
38+
if there is a stack tCaller then
39+
send "revSEFindFinalize" to tCaller
3840
end if
3941
pass closeCard
4042
end closeCard
@@ -135,7 +137,11 @@ command updateButtonStates
135137
end updateButtonStates
136138

137139
private function getCaller
138-
return the long id of the cCaller of the owner of me
140+
if there is a stack (the cCaller of the owner of me) then
141+
return the long id of the cCaller of the owner of me
142+
else
143+
return empty
144+
end if
139145
end getCaller
140146

141147
# Returns

0 commit comments

Comments
 (0)