Content deleted Content added
m Reverted edit by 103.28.116.119 (talk) to last version by Cewbot |
|||
(6 intermediate revisions by 5 users not shown) | |||
Line 1:
{{WikiProject banner shell|
{{WikiProject Redirect}}
}}
== Why am I confused? ==
Line 214 ⟶ 215:
[[User:Tomastvivlaren|Tomastvivlaren]] ([[User talk:Tomastvivlaren|talk]]) 10:40, 1 March 2022 (UTC)
:I solved the problem temporarily using ugly template code in {{tl|Get QID}}.[[User:Tomastvivlaren|Tomastvivlaren]] ([[User talk:Tomastvivlaren|talk]]) 17:16, 1 March 2022 (UTC)
== Protected edit request on 16 April 2023 ==
{{edit fully-protected|Module:Redirect|answered=yes}}
This might be a little excessive for an edit to a fully protected module, but:
I would like to simplify the following (lines 103-107, in function <code>p.luaIsRedirect</code>):
<syntaxhighlight lang="lua">
if titleObj.isRedirect then
return true
else
return false
end
</syntaxhighlight>
to:
<syntaxhighlight lang="lua">
return titleObj.isRedirect
</syntaxhighlight>
because <code>titleObj.isRedirect</code> will only ever yield "true" or "false".
([https://en.wikipedia.org/wiki/Special:ComparePages?page1=Module%3ARedirect&rev1=1043472510&page2=Module%3ARedirect%2Fsandbox&rev2=1150203250&action=&unhide=&diffmode=source diff]) {{'''[[User:Lemondoge|Lemondoge]]'''|[[User talk:Lemondoge|Talk]]|[[Special:Contributions/Lemondoge|Contributions]]}} 21:43, 16 April 2023 (UTC)
:Has this been tested? Scibunto manual does not explicitly say that isRedirect will be true or false. — Martin <small>([[User:MSGJ|MSGJ]] · [[User talk:MSGJ|talk]])</small> 07:38, 17 April 2023 (UTC)
:@Lemondoge: I have noticed your edits to sandbox modules that I monitor. Thanks for the tweaks and thanks for finding the bug noted [[Template talk:Navbox#Short-circuit in ternary expression at line 143|here]]. However, I am not sure there is any benefit from optimizing code unless done as part of a significant effort by someone deeply invested in the particular module. Take this edit request—you are probably correct but who knows and who cares? It can be very challenging to verify rearrangements to boolean expressions. The original here is bulletproof. More importantly, it is easily seen to be bulletproof. I would leave it as is. It's not particularly important, but the edit request would result in uncertainty about what return values can occur while the original code removes any doubt. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 07:59, 17 April 2023 (UTC)
:: Aye, fair enough. {{Withdrawn}} {{'''[[User:Lemondoge|Lemondoge]]'''|[[User talk:Lemondoge|Talk]]|[[Special:Contributions/Lemondoge|Contributions]]}} 12:43, 17 April 2023 (UTC)
|