Commit a0a3cb4b authored by Stefan Behnel's avatar Stefan Behnel

avoid unnecessary object operation in critical memoryview code path

parent f5b096d0
...@@ -330,7 +330,7 @@ cdef class memoryview(object): ...@@ -330,7 +330,7 @@ cdef class memoryview(object):
raise MemoryError raise MemoryError
if flags & PyBUF_FORMAT: if flags & PyBUF_FORMAT:
self.dtype_is_object = self.view.format == b'O' self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
else: else:
self.dtype_is_object = dtype_is_object self.dtype_is_object = dtype_is_object
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment