andgineer / TRegExpr

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

optimize IsMetaChar() #192

Closed Alexey-T closed 4 years ago

Alexey-T commented 4 years ago

function _IsMetaChar(AChar: REChar): boolean; {$IFDEF InlineFuncs}inline;{$ENDIF}
begin
  case AChar of
    'd', 'D',
    's', 'S',
    'w', 'W',
    'v', 'V',
    'h', 'H':
      Result := True
    else
      Result := False;
  end;
end;      

can optimize it via set ['d','D','s','S','w','W','v','V','h','H'] after casting REChar to char.

andgineer commented 4 years ago

You are right - more important it would look better