Skip to content

Commit

Permalink
Small improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
joaoduarte19 committed Oct 16, 2020
1 parent 6b2e1c1 commit 033c66d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sources/MVCFramework.Commons.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1441,7 +1441,7 @@ function CamelCase(const Value: string; const MakeFirstUpperToo: Boolean): strin
function SnakeCase(const Value: string): string;
begin
// Convert multiple underlines to just one
Result := TRegex.Replace(Value, '([_][_{1}]+)', '_');
Result := TRegex.Replace(Value, '([_][_]+)', '_');
// Adds underscores between a lowercase character and an uppercase character
Result := TRegex.Replace(Result, '([a-z0-9])([A-Z])', '\1_\2');
Result := Result.ToLower;
Expand Down

1 comment on commit 033c66d

@danieleteti
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you measured the timing of this new version?

Please sign in to comment.