Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
YouTube Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Module talk:InfoboxImage
(section)
Add topic
Module
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
Add topic
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== 1. Core Module Optimization ([[Module:InfoboxImage/sandbox]]) === * '''File Namespace Caching (Performance):''' The current production code queries and rebuilds the file namespace aliases table via `mw.site.namespaces[6]` twice on ''every single invocation'' (once inside `IsPlaceholder` and again in the main function body). On long pages or transclusions, this creates unnecessary overhead. The proposed version builds this namespace cache list exactly once at the top-level scope during the initial module load. * '''Redundant Code & Asserts Cleanup:''' Removed several `assert(image ~= nil)` checks right after `mw.ustring.gsub`. In the Scribunto environment, these standard string operations never return `nil` when provided with valid string inputs, meaning these assertions were purely redundant and polluting the code logic. * '''Namespace Stripping Helper:''' Unified the file prefix stripping logic into a streamlined internal helper function `stripNamespace`, reducing code duplication between functions.
Summary:
Please note that all contributions to YouTube Wiki are considered to be released under the GNU Free Documentation License 1.3 or later (see
YouTubeWiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Module talk:InfoboxImage
(section)
Add topic