Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
QueryR
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julien Lopez
QueryR
Commits
6d61fd8c
Commit
6d61fd8c
authored
8 years ago
by
Lukas Stadler
Browse files
Options
Downloads
Patches
Plain Diff
simplification in UpdateField
parent
abb83ad5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/infix/UpdateField.java
+4
-7
4 additions, 7 deletions
...racle/truffle/r/nodes/builtin/base/infix/UpdateField.java
with
4 additions
and
7 deletions
com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/infix/UpdateField.java
+
4
−
7
View file @
6d61fd8c
...
...
@@ -58,15 +58,12 @@ public abstract class UpdateField extends RBuiltinNode {
@Specialization
protected
Object
update
(
VirtualFrame
frame
,
Object
container
,
String
field
,
Object
value
)
{
Object
updatedObject
=
container
;
if
(!
coerceList
.
profile
(
container
instanceof
RAbstractListVector
))
{
updatedObject
=
coerceList
(
container
,
updatedObject
);
}
return
extract
.
apply
(
frame
,
updatedObject
,
new
Object
[]{
field
},
value
);
Object
list
=
coerceList
.
profile
(
container
instanceof
RAbstractListVector
)
?
container
:
coerceList
(
container
);
return
extract
.
apply
(
frame
,
list
,
new
Object
[]{
field
},
value
);
}
private
Object
coerceList
(
Object
object
,
Object
vector
)
{
if
(
obj
ect
instanceof
RAbstractVector
)
{
private
Object
coerceList
(
Object
vector
)
{
if
(
v
ect
or
instanceof
RAbstractVector
)
{
if
(
castList
==
null
)
{
CompilerDirectives
.
transferToInterpreterAndInvalidate
();
castList
=
insert
(
CastListNodeGen
.
create
(
true
,
true
,
false
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment