Matti Picus avatar Matti Picus committed af96d10

remove redundant code

Comments (0)

Files changed (2)

pypy/module/micronumpy/interp_boxes.py

     def __init__(self, arr, ofs=0, dtype=None):
         self.value = arr # we have to keep array alive
         self.ofs = ofs
-        if not dtype:
-            dtype = arr.dtype
         self.dtype = dtype
 
     def get_dtype(self, space):

pypy/module/micronumpy/types.py

     T = lltype.Char
     BoxType = interp_boxes.W_StringBox
 
-    @specialize.argtype(1)
-    def box(self, value):
-        return self.BoxType(rffi.cast(self.T, value), 0, None)
-
     def _coerce(self, space, w_item):
         return self.box(space.str_w(space.call_function(space.w_str, w_item)))
 
         return interp_boxes.W_VoidBox(arr, 0, arr.dtype)
 
     @jit.unroll_safe
-    def store(self, arr, i, ofs, box):
+    def store(self, value, i, ofs, box):
         assert isinstance(box, interp_boxes.W_VoidBox)
         for k in range(self.get_element_size()):
-            arr.storage[k + i] = box.arr.storage[k + box.ofs]
+            value.storage[k + i] = box.value.storage[k + box.ofs]
 
     @jit.unroll_safe
     def str_format(self, box):
                 first = False
             else:
                 pieces.append(", ")
-            pieces.append(tp.str_format(tp.read(box.arr, box.ofs, ofs)))
+            pieces.append(tp.str_format(tp.read(box.value, box.ofs, ofs)))
         pieces.append(")")
         return "".join(pieces)
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.