diff options
author | Li Jin <dragon-fly@qq.com> | 2024-03-21 09:14:34 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2024-03-21 09:14:34 +0800 |
commit | 4a3cc26c6dfd74e61c8b6480038d6a292ea86e47 (patch) | |
tree | 9554b94cfc15e4acee0c2e60b63af16f1b828207 /spec/outputs/funcs.lua | |
parent | 80b65520da432843f0c63431a1867bd2620bc4ac (diff) | |
download | yuescript-4a3cc26c6dfd74e61c8b6480038d6a292ea86e47.tar.gz yuescript-4a3cc26c6dfd74e61c8b6480038d6a292ea86e47.tar.bz2 yuescript-4a3cc26c6dfd74e61c8b6480038d6a292ea86e47.zip |
remove redundant 'do' blocks in code generation.
Diffstat (limited to 'spec/outputs/funcs.lua')
-rw-r--r-- | spec/outputs/funcs.lua | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/spec/outputs/funcs.lua b/spec/outputs/funcs.lua index c07989e..c1735c4 100644 --- a/spec/outputs/funcs.lua +++ b/spec/outputs/funcs.lua | |||
@@ -224,13 +224,11 @@ do | |||
224 | if item.field then | 224 | if item.field then |
225 | local value = item.field.get("abc") | 225 | local value = item.field.get("abc") |
226 | if value then | 226 | if value then |
227 | do | 227 | local _exp_0 = value:get() |
228 | local _exp_0 = value:get() | 228 | if 123 == _exp_0 then |
229 | if 123 == _exp_0 then | 229 | return false |
230 | return false | 230 | elseif 456 == _exp_0 then |
231 | elseif 456 == _exp_0 then | 231 | handle(item) |
232 | handle(item) | ||
233 | end | ||
234 | end | 232 | end |
235 | end | 233 | end |
236 | end | 234 | end |
@@ -240,13 +238,11 @@ do | |||
240 | if item.field then | 238 | if item.field then |
241 | local value = item.field.get("abc") | 239 | local value = item.field.get("abc") |
242 | if value then | 240 | if value then |
243 | do | 241 | local _exp_0 = value:get() |
244 | local _exp_0 = value:get() | 242 | if 123 == _exp_0 then |
245 | if 123 == _exp_0 then | 243 | return false |
246 | return false | 244 | elseif 456 == _exp_0 then |
247 | elseif 456 == _exp_0 then | 245 | handle(item) |
248 | handle(item) | ||
249 | end | ||
250 | end | 246 | end |
251 | end | 247 | end |
252 | end | 248 | end |
@@ -261,14 +257,12 @@ do | |||
261 | local pwd = req.pwd | 257 | local pwd = req.pwd |
262 | if name ~= nil and pwd ~= nil then | 258 | if name ~= nil and pwd ~= nil then |
263 | if name ~= "" then | 259 | if name ~= "" then |
264 | do | 260 | local user = DB:queryUser(name, pwd) |
265 | local user = DB:queryUser(name, pwd) | 261 | if user then |
266 | if user then | 262 | if user.status == "available" then |
267 | if user.status == "available" then | 263 | return { |
268 | return { | 264 | success = true |
269 | success = true | 265 | } |
270 | } | ||
271 | end | ||
272 | end | 266 | end |
273 | end | 267 | end |
274 | end | 268 | end |