Minifyer skips some variables when written below Main()
See original GitHub issueI suppose this behavior is expected if it minifies from top-to-bottom, going through A to Z. I tried to see if I could balance characters written and instruction count by writing a sort of library of strings that has to be repeated throughout the script. Since I found it messy to keep the library above Program(), I moved it below Main(). As a result, not all of the variables got abbreviated upon deploy.
string
_TARGET = "Target",
_RANGE = "Range",
_METEORS = "Meteors",
_MISSILES = "Missiles",
_SMALLSHIPS = "SmallShips",
_LARGESHIPS = "LargeShips",
_CHARACTERS = "Characters",
_STATIONS = "Stations",
_NEUTRALS = "Neutrals",
_ON = "_On",
_OFF = "_Off",
_ONOFF = "OnOff",
_ATMOSPHERIC = "atmospheric",
_HYDROGEN = "hydrogen",
_ION = "ion";
string y=“Target”,_RANGE=“Range”,_METEORS=“Meteors”,_MISSILES=“Missiles”,C=“SmallShips”,D=“LargeShips”,E=“Characters”,F=“Stations”,G=“Neutrals”,H=“_On”,_OFF=“_Off”,J=“OnOff”,K=“atmospheric”,L=“hydrogen”,M=“ion”;
When I moved the collection of strings back up to the top, above Program(), it was no longer an issue.
Easiest solution: User writes variables at the top where they are expected to be found procedurally.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
Well I would have preferred if you’d actually zipped your solution, but I can probably make this work 😉
PS: You should probably make those strings
const string
, I assume they’ll never actually change during runtime.Since the minifier is being completely rewritten from scratch, this issue is no longer relevant.