Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
81680637
Commit
81680637
authored
5 years ago
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modernise and simplify some code in MemoryView.pyx.
parent
f70c9f4d
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
Cython/Utility/MemoryView.pyx
Cython/Utility/MemoryView.pyx
+5
-6
No files found.
Cython/Utility/MemoryView.pyx
View file @
81680637
...
...
@@ -1176,11 +1176,10 @@ cdef void copy_strided_to_strided({{memviewslice_name}} *src,
@
cname
(
'__pyx_memoryview_slice_get_size'
)
cdef
Py_ssize_t
slice_get_size
({{
memviewslice_name
}}
*
src
,
int
ndim
)
nogil
:
"Return the size of the memory occupied by the slice in number of bytes"
cdef
int
i
cdef
Py_ssize_t
size
=
src
.
memview
.
view
.
itemsize
cdef
Py_ssize_t
shape
,
size
=
src
.
memview
.
view
.
itemsize
for
i
in
range
(
ndim
)
:
size
*=
s
rc
.
shape
[
i
]
for
shape
in
src
.
shape
[:
ndim
]
:
size
*=
s
hape
return
size
...
...
@@ -1197,11 +1196,11 @@ cdef Py_ssize_t fill_contig_strides_array(
if
order
==
'F'
:
for
idx
in
range
(
ndim
):
strides
[
idx
]
=
stride
stride
=
stride
*
shape
[
idx
]
stride
*=
shape
[
idx
]
else
:
for
idx
in
range
(
ndim
-
1
,
-
1
,
-
1
):
strides
[
idx
]
=
stride
stride
=
stride
*
shape
[
idx
]
stride
*=
shape
[
idx
]
return
stride
...
...
This diff is collapsed.
Click to expand it.
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