I was debugging an issue where a Delphi SOAP implementation was shoe-horned into an Indy server and came across the [WayBack] TWebRequest.UpdateMethodType Method.
The further you get down the if/then/else tree, the more often the indexed property Method is accessed, same for the conversion/comparison code.
property Method: string index 0 read GetStringVariable;
So if the HTTP method is POST (very common), then the calls are being made 3 times:
procedure TWebRequest.UpdateMethodType;
begin
{$IFDEF NEXTGEN}
if Method = 'GET' then { do not localize }
FMethodType := mtGet
else if Method = 'PUT' then { do not localize }
FMethodType := mtPut
else if Method = 'POST' then { do not localize }
FMethodType := mtPost
else if Method = 'HEAD' then { do not localize }
FMethodType := mtHead
else if Method = 'DELETE' then { do not localize }
FMethodType := mtDelete
else if Method = 'PATCH' then { do not localize }
FMethodType := mtPatch;
{$ELSE !NEXTGEN}
if System.AnsiStrings.AnsiStrComp(PAnsiChar(Method), 'GET') = 0 then { do not localize }
FMethodType := mtGet
else if System.AnsiStrings.AnsiStrComp(PAnsiChar(Method), 'PUT') = 0 then { do not localize }
FMethodType := mtPut
else if System.AnsiStrings.AnsiStrComp(PAnsiChar(Method), 'POST') = 0 then { do not localize }
FMethodType := mtPost
else if System.AnsiStrings.AnsiStrComp(PAnsiChar(Method), 'HEAD') = 0 then { do not localize }
FMethodType := mtHead
else if System.AnsiStrings.AnsiStrComp(PAnsiChar(Method), 'DELETE') = 0 then { do not localize }
FMethodType := mtDelete
else if System.AnsiStrings.AnsiStrComp(PAnsiChar(Method), 'PATCH') = 0 then { do not localize }
FMethodType := mtPatch;
{$ENDIF NEXTGEN}
end;
–jeroen