[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Condenseable?
- From: Ando Sonenblick <ando@...>
- Date: Sun, 24 Aug 2003 20:18:14 -0700
Gang, can this following code be condensed somehow into a single execution
"block" (without making it a subroutine)?
local table = GetSomeTable()
if table then
result = table[key]
end
I currently have something like this:
local result = GetSomeResult()
if result == nil then
local table = GetSomeTable()
if table then
result = table[key]
end
return result
And I'm wondering if there is a way to make it more "inline" like:
return GetSomeResult() or
do
local table = GetSomeTable()
if table then
return table[key]
end
return nil
end
end