Skip to content
Snippets Groups Projects
Commit d5cc7b0bb503 authored by Kurt Smith's avatar Kurt Smith
Browse files

ensure util code isn't declared twice in MemoryViewSliceType

parent 0ed07d1e8542
No related branches found
No related tags found
No related merge requests found
......@@ -365,8 +365,7 @@
c_copy_util_code.impl += \
MemoryView.get_copy_contents_code(self, to_memview_c, copy_contents_name_c)
if (MemoryView.get_copy_contents_code(self, to_memview_c, copy_contents_name_c) !=
MemoryView.get_copy_contents_code(self, to_memview_f, copy_contents_name_f)):
if copy_contents_name_c != copy_contents_name_f:
f_copy_util_code.proto += ('static int %s'
'(const __Pyx_memviewslice *,'
......@@ -376,4 +375,8 @@
f_copy_util_code.impl += \
MemoryView.get_copy_contents_code(self, to_memview_f, copy_contents_name_f)
c_copy_used = [1 for util_code in self.env.global_scope().utility_code_list if c_copy_util_code.proto == util_code.proto]
f_copy_used = [1 for util_code in self.env.global_scope().utility_code_list if f_copy_util_code.proto == util_code.proto]
if not c_copy_used:
self.env.use_utility_code(c_copy_util_code)
......@@ -379,5 +382,7 @@
self.env.use_utility_code(c_copy_util_code)
self.env.use_utility_code(c_copy_util_code)
if not f_copy_used:
self.env.use_utility_code(f_copy_util_code)
# ensure the right util code is used
MemoryView.use_cython_array(self.env)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment