dubada01 / SWTORCombatParser

9 stars 2 forks source link

Code optimization and quality improvements suggestion #13

Open L34T opened 7 months ago

L34T commented 7 months ago

Where(foo).Count() may be replaced with Count(foo)

(CA1860) ActivePhases is List. Lists(like all other collections) have it's size stored. So ActivePhases.Count == 0 could be used instead (23)

(CA1847) Single quotation marks in characterName.Contains() forsing search for char instead substring (8)

Object initialization may increase readability new foo() {bar = 1, baz = 2}

Switch statement used in switch expression way so it may be converted into expression (11)

return challenge.ChallengeType switch {
    ChallengeType.DamageOut => foo,
    ChallengeType.DamageIn => bar }
dubada01 commented 6 months ago

Thanks for your suggestions! I've marked the ones that I've implemented, and I'll be keeping this open and evaluating further enhancements. It'll be implemented with #14