Skip to content

Commit 683564d

Browse files
committed
[truffle] Use a nqp::hash literal instead of a bunch of assignments
1 parent 8f8739c commit 683564d

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/vm/jvm/Truffle.nqp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ my $VOID := -1; # Value of this type shouldn't exist
66
my $CALL_ARG := 5; # Something that will be passed to a sub/method call
77
my $RETVAL := 8; # Something that will be returned from a sub/method call
88

9-
my %type_names;
10-
%type_names{$OBJ} := 'OBJ';
11-
%type_names{$INT} := 'INT';
12-
%type_names{$NUM} := 'NUM';
13-
%type_names{$STR} := 'STR';
14-
%type_names{$VOID} := 'VOID';
15-
%type_names{$CALL_ARG} := 'CALL_ARG';
16-
%type_names{$RETVAL} := 'RETVAL';
9+
my %type_names := nqp::hash(
10+
$OBJ, 'OBJ',
11+
$INT, 'INT',
12+
$NUM, 'NUM',
13+
$STR, 'STR',
14+
$VOID, 'VOID',
15+
$CALL_ARG, 'CALL_ARG',
16+
$RETVAL, 'RETVAL',
17+
);
1718

1819
# Constant mapping.
1920
my %const_map := nqp::hash(

0 commit comments

Comments
 (0)