There’s nothing more you can optimize there. And I doubt that THIS is the slowest place in your program.
However your null-values are a bit odd. -999 for numbers? DateTime.Now
for a DateTime? Are you sure that won’t cause problems in other code? Those are pretty normal values which means that other code won’t be able to distinguish whether you had a null, or an actual value. And this default value might be wrong for the other code.
If it was me, I’d use 0 for integer, and DateTime.MinValue
for DateTime
. Or better yet – just stick to nullables all the way.
2
solved Optimize parsing more and more…. in C# [closed]