diff options
author | Valerii Sokolov <valerii.sokolov@uantwerpen.be> | 2015-06-09 11:26:42 +0200 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2015-06-22 16:58:16 +0200 |
commit | 26198f7e1fbed9d294fc2856f796f408c85b66f3 (patch) | |
tree | 82e2cba94285360bd5ef915265fd33de639ffaae /python/astra/utils.pyx | |
parent | 7a4cfe2e5fe384691f0516020b2fcd48b35a7f63 (diff) | |
download | astra-26198f7e1fbed9d294fc2856f796f408c85b66f3.tar.gz astra-26198f7e1fbed9d294fc2856f796f408c85b66f3.tar.bz2 astra-26198f7e1fbed9d294fc2856f796f408c85b66f3.tar.xz astra-26198f7e1fbed9d294fc2856f796f408c85b66f3.zip |
Don't take address of temporary.
Diffstat (limited to 'python/astra/utils.pyx')
-rw-r--r-- | python/astra/utils.pyx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/python/astra/utils.pyx b/python/astra/utils.pyx index ddb37aa..a8e9e4e 100644 --- a/python/astra/utils.pyx +++ b/python/astra/utils.pyx @@ -95,7 +95,8 @@ cdef void readDict(XMLNode root, _dc): if val.size == 0: break listbase = root.addChildNode(item) - data = <double*>np.PyArray_DATA(np.ascontiguousarray(val,dtype=np.float64)) + contig_data = np.ascontiguousarray(val,dtype=np.float64) + data = <double*>np.PyArray_DATA(contig_data) if val.ndim == 2: listbase.setContent(data, val.shape[1], val.shape[0], False) elif val.ndim == 1: @@ -129,7 +130,8 @@ cdef void readOptions(XMLNode node, dc): break listbase = node.addChildNode(six.b('Option')) listbase.addAttribute(< string > six.b('key'), < string > item) - data = <double*>np.PyArray_DATA(np.ascontiguousarray(val,dtype=np.float64)) + contig_data = np.ascontiguousarray(val,dtype=np.float64) + data = <double*>np.PyArray_DATA(contig_data) if val.ndim == 2: listbase.setContent(data, val.shape[1], val.shape[0], False) elif val.ndim == 1: |