ducng99 / SimHub-SF1000-UDP

A SimHub plugin that provides more games support for Thrustmasterâ„¢ SF1000 wheel
MIT License
28 stars 4 forks source link

Optimization #13

Closed SHWotever closed 1 year ago

SHWotever commented 1 year ago

Hello !

Just watching at the code, and I see that most data are standard game data : IE :

pluginManager.GetPropertyValue("DataCorePlugin.GameData.LastLapTime") ?? new TimeSpan()

Everything starting with DataCorePlugin.GameData can be replaced directly by direct value access :

pluginManager.LastData?.NewData?.LastLapTime ?? new TimeSpan()

It will skip you lot of overhead and save some significant CPU load :)

ducng99 commented 1 year ago

Thanks! That will definitely help