summaryrefslogtreecommitdiff
path: root/compiler/pexpr.pas
diff options
context:
space:
mode:
authorsvenbarth <svenbarth@3ad0048d-3df7-0310-abae-a5850022a9f2>2021-01-02 23:23:20 +0000
committersvenbarth <svenbarth@3ad0048d-3df7-0310-abae-a5850022a9f2>2021-01-02 23:23:20 +0000
commite73900f23f96704777c07fe081998a92aa39a297 (patch)
treefb06c22179c7025d6331417b00dbb958c05265e8 /compiler/pexpr.pas
parent7917819a0fa14d6c11d1e8e96cf20c1480d6572d (diff)
downloadfpc-e73900f23f96704777c07fe081998a92aa39a297.tar.gz
* use a case statement instead of nested if-then statements
git-svn-id: https://svn.freepascal.org/svn/fpc/trunk@47998 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/pexpr.pas')
-rw-r--r--compiler/pexpr.pas21
1 files changed, 11 insertions, 10 deletions
diff --git a/compiler/pexpr.pas b/compiler/pexpr.pas
index 1558e38263..47801234a3 100644
--- a/compiler/pexpr.pas
+++ b/compiler/pexpr.pas
@@ -3558,17 +3558,18 @@ implementation
(block_type=bt_body) and
(token in [_LT,_LSHARPBRACKET]) then
begin
- if p1.nodetype=typen then
- idstr:=ttypenode(p1).typesym.name
- else
- if (p1.nodetype=loadvmtaddrn) and
- (tloadvmtaddrnode(p1).left.nodetype=typen) then
- idstr:=ttypenode(tloadvmtaddrnode(p1).left).typesym.name
+ idstr:='';
+ case p1.nodetype of
+ typen:
+ idstr:=ttypenode(p1).typesym.name;
+ loadvmtaddrn:
+ if tloadvmtaddrnode(p1).left.nodetype=typen then
+ idstr:=ttypenode(tloadvmtaddrnode(p1).left).typesym.name;
+ loadn:
+ idstr:=tloadnode(p1).symtableentry.name;
else
- if (p1.nodetype=loadn) then
- idstr:=tloadnode(p1).symtableentry.name
- else
- idstr:='';
+ ;
+ end;
{ if this is the case then the postfix handling is done in
sub_expr if necessary }
dopostfix:=not could_be_generic(idstr);