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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xavier Thompson
cython
Commits
010b6c45
Commit
010b6c45
authored
Sep 06, 2019
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modernise and simplify some code in MemoryView.pyx.
parent
dca26bb4
Changes
1
Hide 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 @
010b6c45
...
...
@@ -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
...
...
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