Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
RQL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
cubicweb
RQL
Commits
0110ae78db25
Commit
0110ae78db25
authored
16 years ago
by
Sylvain
Browse files
Options
Downloads
Patches
Plain Diff
tryout: use a set to store variable refs, can't see why a list would be necessary
parent
636bef7fd229
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
nodes.py
+5
-10
5 additions, 10 deletions
nodes.py
with
5 additions
and
10 deletions
nodes.py
+
5
−
10
View file @
0110ae78
...
...
@@ -854,8 +854,7 @@
# main scope for this variable
'
scope
'
:
None
,
# link to VariableReference objects in the syntax tree
# it must be a list to keep order
'
references
'
:
[],
'
references
'
:
set
(),
# relations where this variable is used on the lhs/rhs
'
relations
'
:
set
(),
'
rhsrelations
'
:
set
(),
...
...
@@ -901,5 +900,5 @@
if
not
self
.
stinfo
[
'
possibletypes
'
]:
self
.
stinfo
[
'
possibletypes
'
].
update
(
old
.
stinfo
[
'
possibletypes
'
])
def
register_reference
(
self
,
v
ar
ref
):
def
register_reference
(
self
,
vref
):
"""
add a reference to this variable
"""
...
...
@@ -905,4 +904,3 @@
"""
add a reference to this variable
"""
assert
not
[
v
for
v
in
self
.
stinfo
[
'
references
'
]
if
v
is
varref
]
self
.
stinfo
[
'
references
'
].
append
(
varref
)
self
.
stinfo
[
'
references
'
].
add
(
vref
)
...
...
@@ -908,3 +906,3 @@
def
unregister_reference
(
self
,
v
ar
ref
):
def
unregister_reference
(
self
,
vref
):
"""
remove a reference to this variable
"""
...
...
@@ -910,8 +908,5 @@
"""
remove a reference to this variable
"""
for
i
,
_varref
in
enumerate
(
self
.
stinfo
[
'
references
'
]):
if
varref
is
_varref
:
del
self
.
stinfo
[
'
references
'
][
i
]
break
self
.
stinfo
[
'
references
'
].
remove
(
vref
)
def
references
(
self
):
"""
return all references on this variable
"""
...
...
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