andgineer / TRegExpr

Regular expressions (regex), pascal.
https://regex.sorokin.engineer/en/latest/
MIT License
174 stars 63 forks source link

Simpler InvertCase code, remove old property #168

Closed Alexey-T closed 4 years ago

Alexey-T commented 4 years ago

I suggest to delete

const
  RegExprInvertCaseFunction: TRegExprInvertCaseFunction = nil;
var
    fInvertCase: TRegExprInvertCaseFunction;
public
    // Set this property if you want to override case-insensitive functionality.
    // Create set it to RegExprInvertCaseFunction (InvertCaseFunction by default)
    property InvertCase: TRegExprInvertCaseFunction read fInvertCase write fInvertCase; // ##0.935

to use INLINE InvertCase like this

  Result := _UpperCase(Ch);
  if Result = Ch then
    Result := _LowerCase(Ch);

we will reduce CALLs.

andgineer commented 4 years ago

agree. I think nobody actually need this property anymore