Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Carlos Ramos Carreño
neoppod
Commits
60bcbc5c
Commit
60bcbc5c
authored
Apr 02, 2021
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PartitionTable: small optimization
parent
aa48adf9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
neo/lib/pt.py
neo/lib/pt.py
+4
-8
No files found.
neo/lib/pt.py
View file @
60bcbc5c
...
...
@@ -120,13 +120,9 @@ class PartitionTable(object):
def
getReadableOffsetList
(
self
,
uuid
):
""" Return the partition assigned to the specified UUID """
assigned_partitions
=
[]
for
offset
in
xrange
(
self
.
np
):
for
cell
in
self
.
getCellList
(
offset
,
readable
=
True
):
if
cell
.
getUUID
()
==
uuid
:
assigned_partitions
.
append
(
offset
)
break
return
assigned_partitions
return
[
offset
for
offset
,
cell_list
in
enumerate
(
self
.
partition_list
)
if
uuid
in
(
cell
.
getUUID
()
for
cell
in
cell_list
if
cell
.
isReadable
())]
def
hasOffset
(
self
,
offset
):
try
:
...
...
@@ -149,7 +145,7 @@ class PartitionTable(object):
return
list
(
self
.
partition_list
[
offset
])
def
getPartition
(
self
,
oid_or_tid
):
return
u64
(
oid_or_tid
)
%
self
.
getPartitions
()
return
u64
(
oid_or_tid
)
%
self
.
np
def
getOutdatedOffsetListFor
(
self
,
uuid
):
return
[
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment