]> git.smokeofanarchy.ru Git - space-station-14.git/commit
Cache regex instances in most cases (#27699)
authorPieter-Jan Briers <pieterjan.briers+git@gmail.com>
Sun, 5 May 2024 22:57:32 +0000 (00:57 +0200)
committerGitHub <noreply@github.com>
Sun, 5 May 2024 22:57:32 +0000 (08:57 +1000)
commit4a2a63a86b0ad36a2850e5750bfd5e653cb2ebd6
tree69e4dc11a396161556a6035a7732956552a11871
parent70d3cf7ba411ef38818f63eec944c4f0c7c33c98
Cache regex instances in most cases (#27699)

Using static Regex functions that take in a pattern is bad because the pattern constantly needs to be re-parsed. With https://github.com/space-wizards/RobustToolbox/pull/5107, the engine has an analyzer to warn for this practice now.

This commit brings most of content up to snuff already, though some of the tricker code I left for somebody else.
Content.Server/Speech/EntitySystems/FrenchAccentSystem.cs
Content.Server/Speech/EntitySystems/FrontalLispSystem.cs
Content.Server/Speech/EntitySystems/LizardAccentSystem.cs
Content.Server/Speech/EntitySystems/MobsterAccentSystem.cs
Content.Server/Speech/EntitySystems/MothAccentSystem.cs
Content.Server/Speech/EntitySystems/ParrotAccentSystem.cs
Content.Server/Speech/EntitySystems/PirateAccentSystem.cs
Content.Server/Speech/EntitySystems/ScrambledAccentSystem.cs
Content.Server/Speech/EntitySystems/SouthernAccentSystem.cs
Content.Shared/Preferences/HumanoidCharacterProfile.cs