rickard67 / Emmet-Pascal

Emmet components for use in Delphi or Lazarus
Other
10 stars 11 forks source link

7 equal fragments in code #13

Closed Alexey-T closed 11 months ago

Alexey-T commented 11 months ago
  Result := StringReplace(Result, '\n', #13#10, [rfReplaceAll]);
  Result := StringReplace(Result, '\t', #9, [rfReplaceAll]);

occurs N times. DRY principle.

rickard67 commented 11 months ago

True... but it's not actually executed N times when processing an expression.

Would it be consistent with the DRY principal to simply add the two lines inside a function and call the function instead?

Alexey-T commented 11 months ago

yes. solved in git.